Splitting a file into multiple files based on first column
Posted: Thu Jun 29, 2006 8:52 am
Hi,
I have a big file ( '|' delimted ). I need to split this file into multiple files based on the value in the first column.
all the rows with the same first column value should go into one file.|77
there are 314 diffrent values in first column so the big file needs to split in to 314 different files.
example:
xx|33|55|66|ggg|ddfc|
xx|67|67|89||568|fdsk|
zz|44|67|55||568|fdsk|
yy|456|jdfjd|dfksd|567|67|
xx|45|67|49||588|fdsk|
zz|67|67|89||568|fdsk|
output files are 3
xx.txt
xx|33|55|66|ggg|ddfc|
xx|67|67|89||568|fdsk|
xx|45|67|49||588|fdsk|
yy.txt
yy|456|jdfjd|dfksd|567|67|
zz.txt
zz|67|67|89||568|fdsk|
zz|44|67|55||568|fdsk|
Thanks,
Ram
I have a big file ( '|' delimted ). I need to split this file into multiple files based on the value in the first column.
all the rows with the same first column value should go into one file.|77
there are 314 diffrent values in first column so the big file needs to split in to 314 different files.
example:
xx|33|55|66|ggg|ddfc|
xx|67|67|89||568|fdsk|
zz|44|67|55||568|fdsk|
yy|456|jdfjd|dfksd|567|67|
xx|45|67|49||588|fdsk|
zz|67|67|89||568|fdsk|
output files are 3
xx.txt
xx|33|55|66|ggg|ddfc|
xx|67|67|89||568|fdsk|
xx|45|67|49||588|fdsk|
yy.txt
yy|456|jdfjd|dfksd|567|67|
zz.txt
zz|67|67|89||568|fdsk|
zz|44|67|55||568|fdsk|
Thanks,
Ram