Splitting input files into multiple files through AWK command

Hi,

I needs to split *.txt files from single directory depends on the some mutltiple input values. i have wrote the code like below

for file in *.txt
do
grep -i -h "value1|value2" $file > $file;
done.

My requirment is more input values needs to be given in grep; let us say 50 values($value1,$value2.....$value50).
is there any good way of writing the code.

example
aaa 1111 ee3456
bbb 2222 bb7658
kkk 8888 nn1234
hhh 5555 bb4444
lll 9999 ee0987

Also is it possible to split the file starting from 11th position to 15th position;
becaz i want split the file by considering position from the files so that my input values will reduce. like in exapmle(there are repeted values ee bb nn bb ee etc) from the file.

is that can be achived through AWK command?

Thanks in advance.

Any suggestios for the above problem?

Do you want to split input file according to values?

yes. I need to split the files according to given input values. Only thing is input values are almost 50. But if consider the position the input values will become less as shown below.

aaa 1111 ee3456
bbb 2222 bb7658
kkk 8888 nn1234
hhh 5555 bb4444
lll 9999 ee0987

if you aboserve the above in 3rd colomn first 2 letters are repeating. so if i consider the position (11th to 15th). i can give only 10 input values.