Hi All,
Iam importing a txt file the sample input is
name: roxy
place: chili
job_type: emp
status: active
block: A
manager: vick
duration: 2
now i want output as
name place job_type status block manager duration
roxy chili emp active A vick 2
i tried with delimiter : but iam not getting required output, Any one encountered the same issue?
unable to import file in required format
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 91
- Joined: Wed Apr 20, 2005 7:59 pm
- Location: U.S.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You will need to read the file as if it contains two fields with ":" as the delimiter then, in a Transformer stage, direct values into the appropriate columns depending on the value of the field name. Use stage variables so that you only change the affected column in each case.
Set another output column to contain a unique key for each record (increment each time "name:" occurs) and use a downstream Aggregator stage to preserve the last record in each group grouped by that key.
Set another output column to contain a unique key for each record (increment each time "name:" occurs) and use a downstream Aggregator stage to preserve the last record in each group grouped by that key.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hi ray,
"in a Transformer stage, direct values into the appropriate columns depending on the value of the field name. ... "
To the above suggestion if we take 2 fieldslike
field1 field2
name roxy
place chili
job_type emp
status active
block A
manager vick
duration 2
How can we direct this to appropriate colums ?sorry for taking your time
"in a Transformer stage, direct values into the appropriate columns depending on the value of the field name. ... "
To the above suggestion if we take 2 fieldslike
field1 field2
name roxy
place chili
job_type emp
status active
block A
manager vick
duration 2
How can we direct this to appropriate colums ?sorry for taking your time