Or, if the separator can be either SPACE or TAB (or both
plus something else), in awk
Code:
BEGIN{
FS="add your separator(s) of choice"
numf=numFields
}
{
for(i=1;i<=NF;i++) {
if(i <= numf) {
printf "%s ", $i >> "file1"
if(i==numf){
printf "\n" >> "file1"
}
} else {
printf "%s ", $i >> "file2"
if(i==NF){
printf "\n" >> "file2"
}
}
}
}
Save as something.awk
Run like so:
Code:
awk -v numFields=102 -f something.awk your-file
Untested, as always, and w/o any warranty.
Cheers,
Tink