Home   Archive   Permalink

Getting values from a table

I have a table having several hundred lines. The data within the table is very structured. In each row/line of the table I need to obtain the character strings in the 121st to the 131st positions. I need to create one large block with the values found during this line by line process... I can waste time retelling what I've tried but, long story short, I'm a newbie and just not accomplishing what I need. Any help would be appreciated

posted by:   Neil     10-Sep-2013/18:33:02-7:00

Hi Neil,
How is your data saved - in a text file? And to clarify, does each line in your data consist of one long string, and you need to extract characters 121-131 on each line. Or are there, for example, several hundred fields per line in a CSV file, and you need to extract fields 121-131 on each line?
In the first case, you could do this:
extracted: copy []
foreach line read/lines %mydata.txt [
     append extracted copy/part at line 121 11
For the second option, you could do something like this:
extracted: copy []
foreach line read/lines %mydata.csv [
     data: parse line ","
     append extracted copy/part at data 121 11

posted by:   Nick     10-Sep-2013/22:24:28-7:00

Nick- the former. Thanks a bunch. Btw- I need to hire you for a few hours work. Could you pm me if you have time? Thanks a million.

posted by:   Neil     10-Sep-2013/23:24:40-7:00