awk command to split file
Hello, I have a file containing more than 200 columns. I need to split in into 2 files, both containing a little more than 100 column. I know you can use the command: awk '{print $1,$2, etc}' < input file > output file But doing it like this mean I have to type in all colums in the command ($1,$2,$3 etc). Is there a way to split the files into a certain amount of columns by giving a range in the command? Many thanks for help!!
|
cut -f -100
cut -f 100- man cut |
Could You try this:
If tab separated Quote:
Quote:
|
Or, if the separator can be either SPACE or TAB (or both
plus something else), in awk Code:
BEGIN{ Run like so: Code:
awk -v numFields=102 -f something.awk your-file Cheers, Tink |
All times are GMT -5. The time now is 11:33 AM. |