in reply to Need Help Parsing File

In the example data you gave, it looks like the first "cell" of a new record begins with a ID field of some type. This field appears to have at least 4 digits. So I would work with that. Use a regex to check the field after your split and see if there are 4 digits in a row. If not, then add that information to the existing record. If it does, then its a new record.

Scan the rest of the records near the end of the file. You shouldn't need to worry too much unless you see a record with only 3 digits in that first ID field.

Just a thought as well, this looks like a straight import into something, so don't spend a lot of time making it look pretty if you are just going to throw data into a database and never use the script again. Wam Bam.. as the saying goes.

webadept

Every day someone is doing what someone else said is impossible.