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
Give an idea of system variables.
What are the various kinds of containers available in datastage?
what are the errors,warnings in datastage
What are datastage sequences?
What is the flow of loading data into fact & dimensional tables?
How rejected rows are managed in datastage?
Distinguish between informatica & datastage. Which one would you choose and why?
Define data aggregation?
Hi guys, Please design a job for dis requirement with derivation(solution). my source table like dis. emp_no qualification 1 a 1 c 2 a 3 c 3 b To loaded to target like dis emp_no qualification 1 b 2 b 2 c 3 a my requirement is every employer have three qualifications i.e a,b and c. what qualification missed in source table that will be move to target systems. Hope u got it the requirement. Right Thanks.
How do you schedule or monitoring the job?
Define ds designer?
Field,NVL,INDEX,REPLACE,TRANSLATE,COLESC
What is "fatal error/rdbms code 3996" error?
Difference between server jobs & parallel jobs?
What is process model?