split files using awk (or similar)
All,
I have a huge file like this: aaa 222 444 rrr aaa 234 123 lop bbb 234 234 kio bbb 567 345 jjj ccc 765 567 ghj ccc 544 678 fre ccc 444 789 der I basically need to split the file in a way that: file aaa.txt shall contain only rows where the first field is aaa: aaa 222 444 rrr aaa 234 123 lop file bbb.txt shall contain only rows where the first field is bbb: bbb 234 234 kio bbb 567 345 jjj etc, etc. I am sure this is simple and can be done using awk or c-shell script ......... many thanks, Luca |
I don't know c-shell nor awk, but in bash :
Code:
while read line; do |
All times are GMT -5. The time now is 10:08 PM. |