Thanks, but I don't have any of the associated files open when I run the script.
It works on one set of data typed out in notepad but fails to work on the required set of data. It's as if there is an error/null value in the data that i can't see using notepad etc but awk does when using this command
First few lines of the set of data as pasted from word pad. Final goal is to extract data to files eg. A140 - Address 00.csv that has all fields associated with this line.
249,A140 - Address 00,1,1,NULL,2008-04-01 17:01:30.857,0
250,A142 - Address 01,1,NULL,1,2008-04-01 17:01:30.950,0
250,A142 - Address 01,1,NULL,1,2008-04-01 17:01:31.013,81
251,A142A - Address 02,1,NULL,1,2008-04-01 17:01:31.043,0
251,A142A - Address 02,1,NULL,1,2008-04-01 17:01:31.060,81
252,A140 - Address 03,1,1,NULL,2008-04-01 17:01:31.123,0
253,A142 - Address 04,1,NULL,1,2008-04-01 17:01:31.247,0
253,A142 - Address 04,1,NULL,1,2008-04-01 17:01:31.263,81
254,E208 1,1,1,1,2008-04-01 17:01:31.873,0
254,E208 1,1,1,1,2008-04-01 17:01:31.890,81
255,E208 2,1,1,1,2008-04-01 17:01:31.950,0
255,E208 2,1,1,1,2008-04-01 17:01:31.950,81
Regards