Computing.Net > Forums > Windows XP > Redirect file content into 2 files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Redirect file content into 2 files

Reply to Message Icon

Name: muralismile
Date: September 30, 2009 at 05:49:42 Pacific
OS: AIX 5L 64 bit
Product: Ibm Xl c/c++ for aix - license
Subcategory: General
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: wanderer
Date: September 30, 2009 at 10:17:55 Pacific
Reply:

Programming forum. Not an xp issue nor a linux/unix one.


0
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Redirect file content into 2 files

XP Op Sys split large file into 2.. www.computing.net/answers/windows-xp/xp-op-sys-split-large-file-into-2/172965.html

Split a DivX file into 2 working files? www.computing.net/answers/windows-xp/split-a-divx-file-into-2-working-files/8649.html

files compounded into 2 HUGE files www.computing.net/answers/windows-xp/files-compounded-into-2-huge-files/82829.html