Cut and paste data in new file

HI Guys,

I have file A:

Abc XyZ Abc Xyz Kal Kaloo 
Abc XyZ Abc Xyz Kalpooo 
Abc XyZ Abc Xyz  Kloo 
Abc  Abc  Klooo 

I want file B

Abc XyZ Abc Xyz Kal Kaloo 
Abc XyZ Abc Xyz Kalpooo 
Abc XyZ Abc Xyz  Kloo 

File A is now 1 lines

Abc  Abc  Klooo 

Cut all lines which have xyz and kal

Thanks

Do you have the same number of columns?
If for example you have 6 columns for each line and you want to separate those which are different in columns 2 and 5 you can use this script:

awk '{close(f);f=$2 OFS $5}{print > f".txt"}' input.txt

input:

Abc XyZ Abc Xyz Kal Kaloo 
Abc XyZ Abc Xyz Kal pooo 
Abc XyZ Abc Xyz Kal oo 
Abc XYz Abc Xyz Kl ooo

outputs:
-XyZ Kal.txt :

Abc XyZ Abc Xyz Kal Kaloo 
Abc XyZ Abc Xyz Kal pooo 
Abc XyZ Abc Xyz Kal oo

-XyZ Kl.txt :

Abc XyZ Abc Xyz Kl ooo

Be aware that it creates as many files as you have variants based on your 2nd and 5th columns.

Maybe I don't get the problem, but I would simply use grep:

grep -vi "xyz" fileA | grep -vi kal > fileB

The -i is for "case insensitive" because you didn't use capitals in "cut all lines which have xyz and kal". You can also combine the two calls into one using disjunction, and do much, much more with grep (see the man page).