Redirect file content into 2 files

Ibm Xl c/c++ for aix - license
September 30, 2009 at 05:49:42
Specs: AIX 5L 64 bit
Sample content of /pshome/fincnv/data1.txt
1
2
3
4
5
6

#!/bin/ksh
while read v1 v2
do
echo "$v1" >> /pshome/fincnv/out1.txt
echo "$v2" >> /pshome/fincnv/out2.txt
done < /pshome/fincnv/data1.txt

How I can redirect all odd values(1,3,5...) to out1.txt and redirect all even values (2,3,4...) to out2.txt ?

Thanks for your help.

Bala.


See More: Redirect file content into 2 files

Report •


#1
September 30, 2009 at 10:17:55
Programming forum. Not an xp issue nor a linux/unix one.

Report •
Related Solutions


Ask Question