Wanna skip exact number lines while reading a file file

Hi all,
I would like to skip exact number of lines while reading a text file.
Let's say I wanna read this text file starting from line no N.
And so I need to skip from fist line to N-1th line.
Does anyone give me a way to do?
Pls with a sample code if possible coz I am not familiar much to java. :P

LineNumberReader class keeps track on line number for you. Sample that skip arg3 lines while copy arg1 file to arg2. Just sample no check, no cleanup.
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.LineNumberReader;
public class Main {
    public static void main(String... args) throws Exception {
        if (args.length != 3)
            throw new IllegalArgumentException("Arguments: infile outfile line_from");
        LineNumberReader reader = new LineNumberReader(
                new FileReader(new File(args[0])) );
        BufferedWriter writer = new BufferedWriter(
                new FileWriter(new File(args[1])) );
        int readFrom = Integer.valueOf(args[2]);
        // skip first lines
        while(reader.getLineNumber() < readFrom) {
            if (reader.readLine() == null)
                throw new IllegalArgumentException("Too few lines");
        // write tail
        String line = null;
        while((line = reader.readLine()) != null) {
            writer.write(line);
            writer.newLine();
        writer.flush();
}

Similar Messages

  • Ignoring last 2 lines while reading the file

    Hi All,
    I have a file structure as mentioned below :
    ab
    ab
    ab
    ab
    =======
    =
    While reading a file , i need to ignore the last 2 lines . How to achieve this using FCC parameters.
    Regards
    Vinay P.

    Hi,
    I am not aware of any parameters in FCC to ignore last lines but work around can be :
    You may create one structure to read last 2 lines if depending on file structure and ignore it in mapping (map all records except this structure).
    Regards,
    Beena.

  • Problem  while reading XML file from Aplication server(Al11)

    Hi Experts
    I am facing a problem while  reading XML file from Aplication server  using open data set.
    OPEN DATASET v_dsn IN BINARY MODE FOR INPUT.
    IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      READ DATASET v_dsn INTO v_rec.
    WHILE sy-subrc <> 0.
      ENDWHILE.
      CLOSE DATASET v_dsn.
    The XML file contains the details from an IDOC number  ,  the expected output  is XML file giving  all the segments details in a single page and send the user in lotus note as an attachment, But in the  present  output  after opening the attachment  i am getting a single XML file  which contains most of the segments ,but in the bottom part it is giving  the below error .
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/SHPORD_0080005842.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    for all the xml  its giving the error in bottom part ,  but once we open the source code and  if we saved  in system without changing anything the file giving the xml file without any error in that .
    could any one can help to solve this issue .

    Hi Oliver
    Thanx for your reply.
    see the latest output
    - <E1EDT13 SEGMENT="1">
      <QUALF>003</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/~1922011.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    E1EDT13 with QUALF>003 and  <E1EDT13 SEGMENT="1">
    with   <QUALF>001 having almost same segment data . but  E1EDT13 with QUALF>003  is populating all segment data
    properly ,but E1EDT13 with QUALF>001  is giving in between.

  • Error while reading wsdl file

    I created and deployed a BPEL process with a JMS adapter and DB adapter.
    I have tested this and it works fine.
    After a few days, I try to open the project and the BPEL process, and click on the DB
    adapter and it throws an exception on the designer :
    "Error while reading wsdl file ... (wsdl file name) NULL Exception"
    This is hard to debug as the exception does not provide any info, NULL.
    This has happened several times for my project. The next time the JMS adapter hit the
    same exception while opening on designer. This one I notice happened after I imported
    a new schema file (xsd) into the BPEL process.
    Only way around that I have for this currently is to delete and recreate the adapters, which as time
    consuming as I have to re-create and re-assign a lot of the activities.
    Has anyone encountered this and is there a way to fix this without deleting/recreating the adapters ?
    Thanks.

    I experienced the same issue and found the cause and a workaround;
    "Error while reading wsdl file …. Exception: null"
    http://www.petervannes.nl/files/b7c08911ce3cde3677e2182bbc5f032a-47.php
    Edited by: 944333 on Jul 3, 2012 10:24 PM

  • Skip the empty line while processing

    Hi all
    i'm reading from a file and i want to skip the empty line and process the line which has some data, but it seem that i doesnot process the "\n"as an empty line
    for example i have the following data
    i went to school
    (empty line)
    5 days a week
    (empty line)
    and i have the following code
        while((line = in.readLine() ) !=null) 
                 if(line!="\n")
                      codes=line.split("   ");
                      }//if else
                      else
                      //do nothing
                      }

    thanks dmbdmb
    it works
    may i ask another question
    i have a file which has several sentences but the spaces between these sentences are not unique i.e some time 3 empty lines some times more or less
    i have a code to make all the spaces just 1 between any sentece but it work with system.out.print but not with files any ideas
    here is the code
            StringBuffer buffer=new StringBuffer();
            try{
                BufferedReader read=new BufferedReader(new FileReader(fname));
    BufferedWriter br = new BufferedWriter(new FileWriter("111.txt"));
                String line=read.readLine();   
                boolean isNewLine=false;
                while(line!=null){
                    if(line.length()==0 && !isNewLine){
                        buffer.append("\n\n");
                                       isNewLine=true;
                    }//if
                    else if(line.length()!=0){
                        buffer.append(line);
                        System.out.println("in ELSE");
                        isNewLine=false;
                    }//else
                    line=read.readLine();
                }//while
                br.write(buffer.toString());
                 read.close();
           br.close();
            }//try
            catch(IOException ioe){
                ioe.printStackTrace();
            }

  • Problem While reading a file in text mode from Unix in ECC 5.0

    Hi Experts,
    I am working on Unicode Upgrade project of ECC5.0.
    Here i got a problem with reading a file format which it does successfully in 4.6 and not in ECC5.0
    My file format was as follows:
    *4 000001862004060300000010###/#######L##########G/##########G/########
    It was successfully converting corresponding field values in 4.6:
    *4
    00000186
    2004
    06
    03
    00000010
    25
    0
    4
    0
    54.75
    0
    54.75
    0.00
    While i am getting some problem in ECC5.0 during conversion of the above line:
    *4 000001862004060300000010###/#######L##########G/##########G/########
    it was consider in the same # values.
    I have used the following statement to open and read dataset.
    OPEN DATASET i_dsn IN LEGACY TEXT MODE FOR INPUT.
    READ DATASET i_dsn INTO pos_rec.
    Thanks for your help.
    Regards,
    Gopinath Addepalli.

    Hi
          You might be facing this problem because of uni code. So while opening or reading the file, there is a statement call ENCODING. Use that option and keep the code page which you want. Then the problem may be solved.
    Thanks & Regards.
    Harish.

  • Error while reading a file from server

    Mine is 9i database and 11.5.10.2 oracle apps server
    I am trying to read PDF file from server, I used the below code
    l_bfile:=bfilename('\u05\app\applmgr\11i\oraclecomn\admin\out\jamuna_server','o7742576.out');
    if DBMS_LOB.FILEEXISTS(l_bfile) = 1 then
    dbms_output.put_line( 'Exists!');
    dbms_output.put_line(dbms_lob.getlength(l_bfile));
    else
    dbms_output.put_line( 'Not Exists!');
    end if;
    i used forward slashes (/) instead of backward slashes (\) too and i also made dbms_output.put_line(to_char(dbms_lob.getlength(l_bfile)));
    while using dbms_log package , i got the below error .I am bit worried since I have created directory and gave sufficicent priviliges too.
    Error report:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01460: unimplemented or unreasonable conversion requested
    ORA-06512: at "SYS.DBMS_LOB", line 485
    ORA-06512: at line 24
    I am sure bfilename('\u05\app\applmgr\11i\oraclecomn\admin\out\jamuna_server','o7742576.out') is give BFILE which is empty.
    Can you please suggest me what I can do to move further? what kind of priviliges it requires to point and read the file from server?
    Please help me in this.
    Thanks in advance

    I suspect you are not using a directory object is the problem.
    Here is the formal description of bfilename
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/functions12a.htm#SQLRF00610
    Sybrand Bakker
    Senior Oracle DBA

  • Error while reading CPS file in jar

    Hi,
    I am getting error :-
    Error while initializing CAZM Factory : CardAuthorizationManagerFactory : getFactory : in one of my class in WSAD
    Root cause i guess its not reading CPS file which is there in one of the jar file.
    Please help me to get solution.
    Regards,
    Divya

    I am also using a raw file destination using a variable.
    I have set DelayValidation = true on both the DataFlow task and even the Sequence Container.
    I get the same error when I run the entire ssis package, however
    when I run the individual container or individual task it runs without an error.
    Also, something interesting is the error is not the same path as the variable name.
    Warning: The system cannot find the file specified.
    Error: File "C:\Users\MyName\AppData\Local\Temp\GUIDNumber\\RawFileName" cannot be opened for reading. Error may occur when there are no privileges or the file is not found. Exact cause is reported in previous error message.
    The variable is "C:\Temp\ProjectName\RawFileName"
    I have other RawFile sources in this same project, but only this one file is giving me grief.
    Any other suggestions?  Is this a bug?
    Have you set an expression for connection string property of raw file? Is it based on variable/expression or configuration? If yes, check the value of variable/ expression or configuraton item at runtime by putting a breakpoint in the pre execute event of task
    and make sure path value its getting is correct. It may be that path is getting a different value at runtime due to expression/configuration set for it.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Facing issue while reading XML file 'LPX-00217: '

    Hi Gurus,
    I am facing one issue while reading the xml file in the one my 11g database instance. The same file if I ran in another instance then it is working fine for me.
    I presume it will be related to NLS character. Please help me in finding out character set.
    And the issue where I am getting instance character set is 'US7ASCII', and I am not getting this issue in another instance where the character set is 'UTF8'.
    And here is the issue I am getting when I was trying to load that file.
    Error Occurred :=ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML
    processing
    LPX-00217: invalid character 150 (U+0096)
    Error at line 1
    Pls help me in debugging this issue.
    Regards,
    Nagendra
    Edited by: 838961 on Jul 12, 2011 9:32 PM

    Hi,
    Pls help me in debugging this issue.There's not much to debug actually.
    The US7ASCII charset stores 7-bit characters, but you're trying to insert a value out of range (150). So that's expected behaviour.
    There were some "tricks" to allow that on some versions, using NLS settings, but it's definitely not the clean way to do it so I won't develop.
    The best thing you have to do is to migrate to character set AL32UTF8, which is fully compliant with XML.

  • Not recognizing # while reading the file from application server

    Hi
    I am reading a file from application server. While reading into internal table with read statement the last field in each record is filling with hash symbol in the last digit. If I write any if condition with HASH symbol its not going inside the if condition, means its not recognizing as hash may be its internally treating as some other. I need to remove the hash from that field. How I can do that.
    Thanks,
    kishore

    I faced exact situation. Yes, internally its treated as some other special character. What i did was, becuase hash symbol was always coming at the end...i created a dummy field in my internal table so that it will not interfere with my actual data. When i see the data in my internal table, the hash always falls in the last field (dummy) which i will ignore. I could not get solution to remove this hash so i adopted this approach and it worked!!
    Hope it helps,
    SKJ

  • How to skip first 5 lines from a txt file when using sql*loader

    Hi,
    I have a txt file that contains header info tat i dont need. how can i skip those line when importing the file to my database?
    Cheers

    Danny Fasen wrote:
    I think most of us would process this report using pl/sql:
    - read the file until you've read the column headers
    - read the account info and insert the data in the table until you have read the last account info line
    - read the file until you've read a new set of column headers (page 2)
    - read the account info and insert the data in the table until you have read the last account info line (page 2)
    - etc. until you reach the total block idenfitied by Count On-line ...
    - read the totals and compare them with the data inserted in the tableOr maybe like this...
    First create an external table to read the report as whole lines...
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE TABLE ext_report (
      2    line VARCHAR2(200)
      3          )
      4  ORGANIZATION EXTERNAL (
      5    TYPE oracle_loader
      6    DEFAULT DIRECTORY TEST_DIR
      7    ACCESS PARAMETERS (
      8      RECORDS DELIMITED BY NEWLINE
      9      BADFILE 'bad_report.bad'
    10      DISCARDFILE 'dis_report.dis'
    11      LOGFILE 'log_report.log'
    12      FIELDS TERMINATED BY X'0D' RTRIM
    13      MISSING FIELD VALUES ARE NULL
    14      REJECT ROWS WITH ALL NULL FIELDS
    15        (
    16         line
    17        )
    18      )
    19      LOCATION ('report.txt')
    20    )
    21  PARALLEL
    22* REJECT LIMIT UNLIMITED
    SQL> /
    Table created.
    SQL> select * from ext_report;
    LINE
    x report page1
    CDC:00220 / Sat Aug-08-2009 xxxxp for 02/08/09 - 08/08/09 Effective Date 11/08/09 Wed Sep-30-2009 08:25:43
    Bill to
    Retailer Retailer Name                  Name on Bank Account           Bank ABA   Bank Acct            On-line Amount  Instant Amount  Total Amount
    ======== ============================== ============================== ========== ==================== =============== =============== ===============
    0100103  BANK Terminal                  raji                           123456789  123456789            -29,999.98    9 0.00         99 -29,999.98
    0100105  Independent 1                  Savings                        123456789  100000002            -1,905.00     9 0.00         99 -1,905.00
    0100106  Independent 2                  system                         123456789  100000003            -800.00       9 -15.00       99 -815.00
    LARGE SPACE
    weekly_eft_repo 1.0 Page: 2
    CDC:00220 / Sat Aug-08-2009 Weekly EFT Sweep for 02/08/09 - 08/08/09 Effective Date 11/08/09 Wed Sep-30-2009 08:25:43
    Bill to
    Retailer Retailer Name Name on Bank Account Bank ABA Bank Acct On-line Amount Instant Amount Total Amount
    ======== ============================== ============================== ========== ==================== =============== =============== ===============
    Count On-line Amount Instant Amount Total Amount
    ============== ====================== ====================== ======================
    Debits 0 0.00 0.00 0.00
    Credits 3 -32,704.98 -15.00 -32,719.98
    Totals 3 -32,704.98 -15.00 -32,719.98
    Total Tape Records / Blocks / Hash : 3 1 37037034
    End of Report
    23 rows selected.Then we can check we can just pull out the lines of data we're interested in from that...
    SQL> ed
    Wrote file afiedt.buf
      1  create view vw_report as
      2* select line from ext_report where regexp_like(line, '^[0-9]')
    SQL> /
    View created.
    SQL> select * from vw_report;
    LINE
    0100103  BANK Terminal                  raji                           123456789  123456789            -29,999.98    9 0.00         99 -29,999.98
    0100105  Independent 1                  Savings                        123456789  100000002            -1,905.00     9 0.00         99 -1,905.00
    0100106  Independent 2                  system                         123456789  100000003            -800.00       9 -15.00       99 -815.00And then we adapt that view to extract the data from those lines as actual columns...
    SQL> col retailer format a10
    SQL> col retailer_name format a20
    SQL> col name_on_bank_account format a20
    SQL> col online_amount format 999,990.00
    SQL> col instant_amount format 999,990.00
    SQL> col total_amount format 999,990.00
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace view vw_report as
      2  select regexp_substr(line, '[^ ]+', 1, 1) as retailer
      3        ,trim(regexp_replace(regexp_substr(line, '[[:alpha:]][[:alnum:] ]*[[:alpha:]]', 1, 1), '(.*) +[^ ]+$', '\1')) as retailer_name
      4        ,trim(regexp_replace(regexp_substr(line, '[[:alpha:]][[:alnum:] ]*[[:alpha:]]', 1, 1), '.* ([^ ]+)$', '\1')) as name_on_bank_account
      5        ,to_number(regexp_substr(regexp_replace(line,'.*[[:alpha:]]([^[:alpha:]]+)','\1'), '[^ ]+', 1, 1)) as bank_aba
      6        ,to_number(regexp_substr(regexp_replace(line,'.*[[:alpha:]]([^[:alpha:]]+)','\1'), '[^ ]+', 1, 2)) as bank_account
      7        ,to_number(regexp_substr(regexp_replace(line,'.*[[:alpha:]]([^[:alpha:]]+)','\1'), '[^ ]+', 1, 3),'999,999.00') as online_amount
      8        ,to_number(regexp_substr(regexp_replace(line,'.*[[:alpha:]]([^[:alpha:]]+)','\1'), '[^ ]+', 1, 5),'999,999.00') as instant_amount
      9        ,to_number(regexp_substr(regexp_replace(line,'.*[[:alpha:]]([^[:alpha:]]+)','\1'), '[^ ]+', 1, 7),'999,999.00') as total_amount
    10* from (select line from ext_report where regexp_like(line, '^[0-9]'))
    SQL> /
    View created.
    SQL> select * from vw_report;
    RETAILER   RETAILER_NAME        NAME_ON_BANK_ACCOUNT   BANK_ABA BANK_ACCOUNT ONLINE_AMOUNT INSTANT_AMOUNT TOTAL_AMOUNT
    0100103    BANK Terminal        raji                  123456789    123456789    -29,999.98           0.00   -29,999.98
    0100105    Independent 1        Savings               123456789    100000002     -1,905.00           0.00    -1,905.00
    0100106    Independent 2        system                123456789    100000003       -800.00         -15.00      -815.00
    SQL>I couldn't quite figure out the "9" and the "99" data that was on those lines so I assume it should just be ignored. I also formatted the report data to fixed columns width in my external text file as I'd assume that's how the data would be generated, not that that would make much difference when extracting the values with regular expressions as I've done.
    So... something like that anyway. ;)

  • FILENOTFOUNDEXCEPTION while reading property files in Tomcat 6------Help me

    Hi All
    I am planning to migrate my web application from iplanet 4.1 to tomcat 6. In this process I need to read the properties files initially.
    for eg: i got the property files in a iPlanet:
    Config directory---
    abc.properties.---
    abc.log--
    In tomcat I configured them in web.xml saying that.
    <servlet>
    <servlet-name>ABC</servlet-name>
    <servlet-class>com.ijk.abc</servlet-class>
    <init-param>
    <param-name>Loan</param-name>
    <param-value>/WEB-INF/config</param-value>
    </init-param>
    <init-param>
    <param-name>loan.props</param-name>
    <param-value>/WEB-INF/config/abc.props</param-value>
    </init-param>
    <init-param>
    <param-name>loan.log</param-name>
    <param-value>/WEB-INF/config/abc.log</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>ABC</servlet-name>
    <url-pattern>/</url-pattern>
    </servlet-mapping>
    I need to read initially all the property files and then proceed.
    While configuring in this way, it am getting error saying that
    abc.props or abc.log..............(FILE NOT FOUND EXCEPTION)
    Can anyone suggest me how to configure them.
    Thanks in Advance.

    Thanks for your response, Actually we dont have the source code for that because it is very old code, but i m using decompiler in which i can get some informtaion.
    OS used for iPlanet is Unix but now I need to deploy this application in tomcat in windows server 2003.
    Servlet clss:
    SERVLET CLASS:
    Class com.ijk.abc implements extends HttpServlet  implements PropertyKeys
    private IClickManager m_im;
    public void init(ServletConfig paramServletConfig)
        throws ServletException
        Utils.info("Servlet initialization");
        try {
          super.init(paramServletConfig);
          Utils.info("ServerInfo: " + getServletContext().getServerInfo());
          PGroup localPGroup = this.m_im.claimPG();
          Utils.trace("Got " + localProcessorGroup + " for initialization");
          this.m_im.gatherProperties(localProcessorGroup);-----------this is where it is calling the property files.
          this.m_im.freePG(localPGroup);
          Utils.trace("Released " + localPGroup + " for new Properties");
          localPGroup = this.m_im.claimPG();
          Utils.trace("Got " + localPGroup + " for new Properties");
          try
            ConHandler localDBHandler = (ConHandler)localPGroup.getDBHandler("config.dbhandler");
            this.m_im.setNumPGs(localDBHandler.getNumPGroups());
          catch (Exception localException1) {
            Utils.info("NON FATAL ERROR: failed to set number of PGs", localException1);
          try
            Session.createAndStartSessionTask(localPGroup);
            localPGroup.resumeAllTasks();
          catch (Exception localException2) {
            Utils.info("NON FATAL ERROR: failed to start tasks", localException2);
          this.m_im.freePG(localPGroup);
          Utils.trace("Released " + localPGroup + " for initialization");
          Utils.info("Servlet initialization finished");
        catch (FatalServletError localFatalServletError) {
          Utils.error("FatalServletError: ", localFatalServletError);
          throw new UnavailableException(this, localFatalServletError.toString());
        catch (Error localError) {
          Utils.error("Error: ", localError);
          throw localError;
    ==========================================================
    public void gatherProperties(ProcessorGroup paramProcessorGroup)
        Object localObject;
        this.m_props.clear();
        String str1 = this.m_servlet.getInitParameter("loan.dir");
        if (str1 == null) {
          str1 = System.getProperty("server.root", System.getProperty("user.dir", "."));
        this.m_props.put("loan.dir", str1);
        String str2 = this.m_servlet.getInitParameter("abc.log");
        setLogFile(str2);
        try
          String str3 = this.m_servlet.getInitParameter("abc.props");
          if (str3 == null)
            str3 = "abc.props";
          localObject = str1 + File.separator + str3;
          Utils.info("Reading properties from file: " + ((String)localObject));
          Utils.loadProperties(this.m_props, new BufferedInputStream(new FileInputStream((String)localObject)));
        catch (IOException localIOException) {
          Utils.info("NON FATAL WARNING: Could not read props file", localIOException);--while running i m getting this error
        Utils.info("Reading properties from Servlet Parameters");
        Enumeration localEnumeration = this.m_servlet.getInitParameterNames();
        while (localEnumeration.hasMoreElements()) {
          localObject = (String)localEnumeration.nextElement();
          this.m_props.put(localObject, this.m_servlet.getInitParameter((String)localObject));
        Utils.info("Reading properties from DB");
        try {
          localObject = (ConDBHandler)paramProcessorGroup.getDBHandler("config.dbhandler");
          String str5 = ((ConDBHandler)localObject).getPropertiesFile();
          Utils.loadProperties(this.m_props, new ByteArrayInputStream(str5.getBytes()));
        catch (Exception localException) {
          Utils.info("NON FATAL WARNING: Could not read props file", localIOException);--while running i m getting this error
        String str4 = this.m_props.getProperty("smtp.host");
        if (str4 != null) MailUtils.setSMTPHost(str4.trim());
        if (str2 == null) {
          str2 = this.m_props.getProperty("abc.log");
          setLogFile(str2);
         runInitializers(paramPGroup);
        Utils.info("New Properties:", this.m_props);
        this.m_rroots = StringUtils.getPathsFromList(this.m_props.getProperty("resource.path", "/com/loan/resources/:/"));
        clearAllPGs();
    =================================================================
    the above is the servlet class and the method which is using to read the property files from root directory in Unix.
    ie../opt/mywebapp/loan/abc.props,abc.log
    loan is the directory in which two property files are placed.
    i just want to where to place property files in tomcat so that its going to read the property files.
    Right now, i placing it in the WEBAPPS/MYWEBAPPLICATION/WEB-INF/LOAN/abc.props,abc.logs.
    Its giving me errors such as FILENOTFOUNDEXCEPTION or cannot read the property files.
    The main problem is ...I donot have the complete source code. while decompiling i m not able view complete source code.
    Please help me regarding this.........
    Thanks in advance.

  • Problem while reading the file from FTP server

    Hi Friends,
    I have a problem while fetching files from FTP server.
    I used FTP_Connect, FTP_COMMAND function modules. I can able to put the files into FTP server.
    but I cant able to pick the files from FTP server.
    anyone have faced similar issues kindly let me know.
    Thanks
    Gowrishankar

    Hi,
    try this way..
    for reading the file using FTP you need to use different unix command ..
    Prabhuda

  • Error while reading excel file from application server into internal table.

    Hi experts,
    My requirement is to read an excel file from application server into internal table.
    Hence I have created an excel file fm_test_excel.xls in desktop and uploaded to app server using CG3Z tcode (as BIN file type).
    Now in my program I have used :
    OPEN DATASET v_filename FOR INPUT IN text mode encoding default.
    DO.
    READ DATASET v_filename INTO wa_tab.
    The statement OPEN DATASET works fine but I get a dump (conversion code page error) at READ DATASET statement.
    Error details:
    A character set conversion is not possible.
    At the conversion of a text from codepage '4110' to codepage '4103':
    - a character was found that cannot be displayed in one of the two
    codepages;
    - or it was detected that this conversion is not supported
    The running ABAP program 'Y_READ_FILE' had to be terminated as the conversion
    would have produced incorrect data.
    The number of characters that could not be displayed (and therefore not
    be converted), is 445. If this number is 0, the second error case, as
    mentioned above, has occurred.
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_CONVERSION_CODEPAGE', was not
    caught and
    therefore caused a runtime error.
    The reason for the exception is:
    Characters are always displayed in only a certain codepage. Many
    codepages only define a limited set of characters. If a text from a
    codepage should be converted into another codepage, and if this text
    contains characters that are not defined in one of the two codepages, a
    conversion error occurs.
    Moreover, a conversion error can occur if one of the needed codepages
    '4110' or '4103' is not known to the system.
    If the conversion error occurred at read or write of  screen, the file
    name was '/usr/sap/read_files/fm_test_excel.xls'. (further information about
    the file: "X 549 16896rw-rw----201105170908082011051707480320110517074803")
    Also let me know whether this is the proper way of reading excel file from app server, if not please suggest an alternative .
    Regards,
    Karthik

    Hi,
    Try to use OPEN DATASET v_filename FOR INPUT IN BINARY mode encoding default. instead of OPEN DATASET v_filename FOR INPUT IN text mode encoding default.
    As I think you are uploading the file in BIN format to Application server and trying to open text file.
    Regards,
    Umang Mehta

  • Error While Reading a file Dynamicall​y in CRIO - 9073

    Hello all,
              I am using CRIO - 9073, here i transferred a file (With size of 5mb) through FTP from my PC..... and then i am trying to read it Dynamically, but while i am reading this file and updating, my CRIO going to stop mode...... So i can't workout more... Give a fine reply all...
    Regards
    Pandithan.

    What code for path building do you have running on the CRIO?
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

Maybe you are looking for