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 do you generate sequence number in datastage?
What are the some differences between 7.x and 8.x version of datastage?
Explaine the implimentation of scd's in ds indetail, please send me step by step procedure to perform scd's 1,2,3. Please replay for this, Thanks in advance
why do u need the IOS upgradation in a FC switch
Can you explain how could anyone drop the index before loading the data in target in datastage?
Have you have ever worked in unix environment and why it is useful in datastage?
How many areas for files does datastage have?
how to export or import the jobs in .ISX file
what are the devoleper roles in real time? plz tell i am new to datastage....
Difference between data warehousing and olap?
How do you import and export data into datastage?
What is a ds designer?
Describe the main features of datastage?
What can we do with datastage director?
Why fact table is in normal form?