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
What is the method of removing duplicates, without the remove duplicate stage?
How do you import and export the datastage jobs?
Can you explain engine tier in information server?
Where the datastage stored his repository?
How do you schedule or monitoring the job?
Could anyone give brief explanation bout datastage admin
What are the partitioning techniques available in link partitioner?
What are routines in datastage?
How one source columns or rows to be loaded in to two different tables?
Why fact table is in normal form?
What are the features of datastage flow designer?
What all are the different way to run a job?
What is the difference between informatica and datastage?
Hi , Can anyone give few examples of scenarios and there corresponding design in datastage..i am new to this tool...confused in design while my manager asking to design the job.. Please post the URL if there..so i can go through it.. Thanks in advance...
What is developer responsibilities in UAT (user acceptance testing and Post implementation phase?