Suppose you have an attached Windows CSV file called "mydata.csv". This code would read it into an array, one line per entry:
oFile = getDataObjectContents( "myfile.csv" ); // open the attachment as a generic binary object
cFile = util.stringFromStream( oFile, "utf-8" ); // convert the entire file into one long string
aRows = cFile.split( "\r\n" ); // create an array of lines
You can then search or loop through the array, looking for a pattern to match to.
To then split one line into columns, use .split( "," )
Thanks for your help on this. Could you be any more specific on how to search through the array and impliment it into the form itself?
Thank you again.
Don't know what your data looks like or how/when you want the form field to be generated, you need to tell us more if you want someone to hand you a finished script.
Sorry I was not specific enough. You can see an example of how I'd prefer to have it set up here: http://designsbynichole.com/EXAMPLE.pdf.
Basically, I'd like to be able to fill in the name in the first box myself, and then have it populate the sales for me. I would also like to be able to have two sets on one PDF at a time if possible, still in pairs of text boxes. i.e. Name, Sales, Name1, Sales1, Name2, Sales2, etc. I'm not sure if this is something that can be accomplished.
Again, I appreciate any help you can offer.
So, I'm thinking that after i put in those first three lines you give me, I have to pull the data from the text box i filled in somehow, then do the loop looking for said value, then do the split, then maybe put that data into a variable and output it to the other text box? Can anyone tell me if this is correct?