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.
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
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!
Are you using the embedded attribute?
<file:readFile fileName="${infile}" var="infileParsed" embedded="true"/>
yes embedded="true" did not make any difference.
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.
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?