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
how to implement scd2 in datastage 7.5 with lookup stage
How one source columns or rows to be loaded in to two different tables?
what should be ensure to run the sequence job so that if its get aborted in 10th job before 9job should get succeeded?
What is the purpose of interprocessor stage in server jobs?
What is ibm datastage flow designer?
Explain Quality stage?
what is the difference between == and eq in UNIX shell scripting?
What is the difference between the local container and shared container?
Differentiate between datastage and datastage tx?
how can we create rank using datastage?what is the meaning of rank?
What is job control?
What are iconv and oconv?
What are the types of jobs we have in datastage?
Give an idea of system variables.
What is the difference between passive stage and active stage?