|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Removing first line from a csv file |
« View previous topic :: View next topic » |
Author |
Message
|
RaviKrG |
Posted: Wed Oct 15, 2008 10:43 pm Post subject: Removing first line from a csv file |
|
|
 Master
Joined: 07 Sep 2008 Posts: 240
|
Hi All,
I have a input csv file which consist of data something like :
"Record","Fname","Mname","Lname","Batch"
"rec1","ABC","PZV","MNO","BC33"
"rec2","XYZ","PTY","SD","BC34"
First line is just the simple heading but I want to remove it during processing.
How can I remove the first line form this so that the outfile file consist of only
"rec1","ABC","PZV","MNO","BC33"
"rec2","XYZ","PTY","SD","BC34"
Thanks |
|
Back to top |
|
 |
sebastianhirt |
Posted: Thu Oct 16, 2008 12:35 am Post subject: |
|
|
Yatiri
Joined: 07 Jun 2004 Posts: 620 Location: Germany
|
You might for example read the whole shebang with the MB6.1 File Input Node, and have the MRM Parser Parsing it. Then you might just use some ESQL or Java and delete the unneeded parts of the Message.
Is this the sort of answer you were looking for? |
|
Back to top |
|
 |
RaviKrG |
Posted: Thu Oct 16, 2008 12:43 am Post subject: |
|
|
 Master
Joined: 07 Sep 2008 Posts: 240
|
Thanks sebastianhirt
Yup ! You can say so but is it really required only to delete the first row ?
Is there any other way |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Oct 16, 2008 3:49 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You can model the header row as a different, non-repeating, element in your csv file.
Then you can fail to copy that to the output message, or otherwise ignore it in your processing.
Your model should match your data's logical structure. If that logical structure includes a header, then so should your model. |
|
Back to top |
|
 |
sebastianhirt |
Posted: Thu Oct 16, 2008 3:53 am Post subject: |
|
|
Yatiri
Joined: 07 Jun 2004 Posts: 620 Location: Germany
|
RaviKrG wrote: |
Thanks sebastianhirt
Yup ! You can say so but is it really required only to delete the first row ?
Is there any other way |
If your header record has a fixed length, you might as well not parse at all, and cut the required length from the BLOB (e.g. the SUBSTRING ESQL function might do the trick for you) |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|