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...

This is UNIX question asked in DataStage Interview.
Say I have n numbers of records in a text file.
I want first 3 records in 1st file, last three records in 3rd file and remaining n-6 records in 2nd file.
(Note: we don't know how many records are there in the File. I am getting one file on daily basis and I want three target files as asked above)

Answer Posted / ram

head -3 filename.txt > t1.txt
tail -3 filename.txt > t2.txt
cat filename.txt|sed '3d,$d'|sed '$d'|sed '$d' > t3.txt

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to implement scd2 in datastage 7.5 with lookup stage

5553


How one source columns or rows to be loaded in to two different tables?

1072


what should be ensure to run the sequence job so that if its get aborted in 10th job before 9job should get succeeded?

1333


What is the purpose of interprocessor stage in server jobs?

2172


What is ibm datastage flow designer?

1084


Explain Quality stage?

1090


what is the difference between == and eq in UNIX shell scripting?

1422


What is the difference between the local container and shared container?

1043


Differentiate between datastage and datastage tx?

1005


how can we create rank using datastage?what is the meaning of rank?

8706


What is job control?

1036


What are iconv and oconv?

1183


What are the types of jobs we have in datastage?

1024


Give an idea of system variables.

963


What is the difference between passive stage and active stage?

1413