Clarity

  • 1.  File:readFile Strign index out of range

    Posted Sep 18, 2016 10:36 PM

    I am running in to the following error. The file is there on the server. not sure why it is resulting in String index our of range. 

    File Error: org.apache.commons.jelly.JellyTagException: null:145:75: <file:readFile> String index out of range: -1. Check input file. /usr/cappm/sftp/TEST/Files/554/007/7554412

     

    Please advice. I need to resolve this asap.



  • 2.  Re: File:readFile Strign index out of range

    Posted Sep 19, 2016 01:15 PM

    Just guess here.

     

    If you have embedded="true" check for a line in your input file that contains just a single double quote.

     

    V/r,

    Gene



  • 3.  Re: File:readFile Strign index out of range

    Posted Sep 20, 2016 10:04 AM

    I found that the problem is with file format. It is resolved now. I am seeing another issue. In the csv, each column is enclosed in double quotes. Some of the fields are descriptive and use commas. File:readFile is treating commas within doublequotes also delimiters. I need to allow users to have commas in the description fields. Any suggestions? Thank you!



  • 4.  Re: File:readFile Strign index out of range

    Posted Sep 20, 2016 10:43 AM

    Are you using the embedded attribute?

     

     <file:readFile fileName="${infile}" var="infileParsed" embedded="true"/>

     

    V/r,

    Gene



  • 5.  Re: File:readFile Strign index out of range

    Posted Sep 20, 2016 12:08 PM

    yes embedded="true" did not make any difference.



  • 6.  Re: File:readFile Strign index out of range

    Posted Sep 20, 2016 01:37 PM

    In your data file do your columns look like:

     

    "This is a test","With embedded , in the , string","10"

     

    Embedded applies the following regex to the input line.

     

    "(,)" which should match just the columns and not delimiters inside the string.

     

     

    V/r,

    Gene



  • 7.  Re: File:readFile Strign index out of range

    Posted Sep 21, 2016 02:58 PM

    Yes, my data looks like your example. "This is a test","With embedded , in the , string","10"

    <file:readFile fileName="${filePath}/${doc_id}" var="inputfile" embedded="true"/>

    should I use a delimiter?