How to exclude first and last lines while reading data into a sequential file(having some 1000 records).I guess probably by using unix filter option but not sure which to use
Answers were Sorted based on User's Feedback
Answer / sam
In sequential file stage, properties tab --- options -- filter
At filter type unix command -- sed '1d;$d'
Is This Answer Correct ? | 8 Yes | 0 No |
In order to exclude the contents while reading from the
sequential file stage we have to use the filter option.
There we have to specify the unix command:
Sed -e '1d' -e '$d' <filename>
Is This Answer Correct ? | 8 Yes | 1 No |
In sequential file stage use the filter in the options
In filter use sed '1d;$d'
You can use sed '<start>,<end>d' to delete particular rows and use sed -n '<start>,<end>p' to keep particular rows
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / shiv
Sreenu is also right, but we have another option as well.
Use head and tail stages in datastage like this:
Seq_File-->Tail_stage--->Head_Stage---->Dataset(Target)
in this way first u can exclude the first record using tail specify 999 record in tail stage, then u can exlclude last record by using head stage.(998 top records).
Is This Answer Correct ? | 1 Yes | 2 No |
Well if must use filter option in sequential stage then
the Ans is:
head -n 10 'FileName' | tail -n 8
explanation:
suppose if ur file has 10 records + column name then total
lines are 11.
col1
1
2
3
4
5
6
7
8
9
10
head -n 10 will fetch column name + 9 records
and
tail -n 8 will fetch 2 to 9 records excluding colname and
1st record.
like :
2
3
4
5
6
7
8
9
Thats it.
Is This Answer Correct ? | 0 Yes | 2 No |
In merge stage can we update the values?
Hi every one, I am Suneel. I/p o/p --- ----- suneel suneel suneel suneel suneel suneel how it will get. Please design job with explain. Thanks.
A flatfile contains 200 records.I want to load first 50 records at first time running the job,second 50 records at second time running and so on,how u can develop the job?pls give the steps?pls pls
Hi This is Vijay, How can your remove the duplicates in sequential File?
15 Answers HCL, Scope International,
Lookup constraints
i want anser this question empno,ename,sal 12,mmm_ww,200 13,nnn_xx,300 14,bbb_qq,400 which stages are take which types of logicks are doing pls help me
Explain connectivity between datastage with datasources?
i having source like emptable,dept table and combined purpose using for the join stage but join stage which partition techq will be prefored? pls given the ans?
What is datastage?
how can we extract data with out having any common column
how to convert rows into columns
What are the unit test cases you used in your project?