Hi all,
I have a file with data that looks like this
CUSTID3478901
pono1 9876534
pono2 6345827
pono3 4567001
CUSTID7650943
pono1 0192835
pono2 6019834
pono3 8876123
pono4 9933457
pono5 7756382
pono6 8566123
The list contains thousands of "CUSTID"s and each CUSTID can have anywhere from 0 to 12 "pono"s.
I need the output to look like:
CUSTID7650943, pono1 0192835, pono2 6019834, pono3 8876123, pono4 9933457, pono5 7756382, pono6 8566123
So to summarize; Match on REGEXP CUSTID, join all following lines, seperated by a comma (,) regardless of number of following lines until REGEXP is matched again and then, start new line starting with REGEXP and join all following lines, seperated by a comma (,) regardless of number of following lines.... until the end of the file is reached.
Thanks in advanced for your responses.
-Joe
I have a file with data that looks like this
CUSTID3478901
pono1 9876534
pono2 6345827
pono3 4567001
CUSTID7650943
pono1 0192835
pono2 6019834
pono3 8876123
pono4 9933457
pono5 7756382
pono6 8566123
The list contains thousands of "CUSTID"s and each CUSTID can have anywhere from 0 to 12 "pono"s.
I need the output to look like:
CUSTID7650943, pono1 0192835, pono2 6019834, pono3 8876123, pono4 9933457, pono5 7756382, pono6 8566123
So to summarize; Match on REGEXP CUSTID, join all following lines, seperated by a comma (,) regardless of number of following lines until REGEXP is matched again and then, start new line starting with REGEXP and join all following lines, seperated by a comma (,) regardless of number of following lines.... until the end of the file is reached.
Thanks in advanced for your responses.
-Joe