12-03-2012 02:57 PM
How can the following file be parsed to fill a cluster as attached?
The county are separated by blank line and that indicates the next array of Item Parsed cluster.
Solved! Go to Solution.
12-04-2012 07:21 AM
First of all, you don't need to get the file size. Leave the read size unwired and it will read the entire file. Also make sure to close the file.
Ok, let's take this 1 step at a time. First you want to get an array of the county data. Since the counties are separated by a blank line, you should use the Spreadsheet String to Array with two end of line characters as the delimiter (put string constant in \ display mode and use "\n\n").
So now we have to figure out how to parse the county data. Use the Spreadsheet String to Array function again, this time with a single end of line character as the delimiter. This separates the county data into lines. The first line is the county name, second the largest city. Run the rest of the array into a FOR loop, parse the string with a tab as the delimiter, and build you cluster.
Clear as mud? If you take it 1 step at a time, it is not that bad.
12-04-2012 11:43 AM
Thanks, taking one step at a time did help;)
I used regular expression and then the for loop to iterate and fill the data.