Split text file

Hi all,

I am very new to shell scripting and some help is greatly appreciated.
I have 10 column based text files, i would like to split each of them into 6 files ; the 1st one having columns 1, 2 ,3,4 , the second one having columns 1,2,8,9 etc.

Is there a way I could get 60 files out my input file by a short script?

Thanks a lot for your help,
Shreyartha

Do this as a two-step process:

(1) use the cut command to break your first file into 10 files, each with one of your columns
(2) use the paste command to create new files (from results of step 1) with whatever combination and order of fields you desire

Note:
there are also other ways to do this
using cut to extract certain columns all in one step
using awk to extract certain columns all in one step

Please post some sample data, making it clear what the field delimited is and how many columns there are.

I can't see the progression here. Can you list all six selections?

What Operating System and version are you using?
What Shell do you use?

Hi ,

There is no progression/pattern of columns. That has to be chosen manually , that is how the file is.
For example the 6 output files should all have columns 1 and 2, in addition file 1 should have columns 3,4 , file 2 has 8 and 9..file 3 has 23 and 24,,,,file 4 has 45,56...file 5 has 57,58..file 6 has 60 and 61..
Sorry for not mentioning this before but rows in the output should NOT have values in column 34 having value "I"..
Example
input file
header 1 2 3 4 5 6 7 8 9 10
1 2 4 5 c 7 8 3 6 3
4 5 6 7 I 6 7 7 7 7
6 7 8 7 t 6 7 4 2 2

All output files should not have the the second row as they have I in the 5th column.

I`m using Cygwin , but I also have access to a Unix machine, version I`m not sure.

Thanks,
Shreyartha