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
im new to this tool im now at project plz tell me step by step process how to design plz help me i wnt to go with exp for job plz give me d proper design and explination
how do u catch bad rows from OCI stage? And what CLI stands for?
what is use of SDR function?
How many areas for files does datastage have?
how to abort the job its matain duplicates?
how to connect source to db?generally what r stages u used? how to find the data is having delimiter format?
Can you define merge?
Notification Activity
what is stage is used for below Input columns: dept|mgr|employee|salary Output columns: mgr|count of employee per mgr|avg salary per dept note: each dept has one mgr and each mgr has many employees
Define project in datastage?
Name the different sorting methods in datastage.
Describe the architecture of datastage?
What is the difference between hashfile and sequential file?
What are datastage sequences?
How to reverse the string using unix?