Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to separate the even and odd number generated from one
file to two separate file i.e. even numbers in file1.txt and
odd numbers in file2.txt

Answer Posted / jaya prasad

echo "Enter the file name"
read file
awk '$NF % 2 == 0' $file > file1.txt
awk '$NF % 2 != 0' $file > file2.txt

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you get the value of pi till a 100 decimal places?

970


How do you know which shell I am using?

1050


Is it possible to substitute "ls" command in the place of "echo" command?

1056


Write a shell script to get current date, time, user name and current working directory.

1092


What is the difference between break and continue commands?

1102


Why are shell scripts used?

1077


What is sed in shell script?

1047


What are "c" and "b" permission fields of a file?

1026


What is batch file programming?

1161


What is bash coding?

927


What shell is bin sh?

967


How do I set bash as default shell mac?

1010


how to print the 2-d, 3-d arrays in unix shell script programs please answer thi questio to my mail venusaikumar@gmail.com

2568


What does it mean by #!/Bin/sh or #!/Bin/bash at the beginning of every script?

1064


How to open a read-only file in the shell?

1127