line terminator
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 6
- Joined: Thu Jan 04, 2007 3:46 am
- Location: Malaysia
line terminator
I have a ~ delimited flat file and using a pipe | as line terminator. How could I set the sequential stage to use pipe as a line terminator?
You can't... at least not directly. You've only got the three choices listed for Line Termination that you've seen:
UNIX Style (LF)
DOS Style (CR LF)
None
One option would be to preprocess the file and replace the pipes with a 'normal' line terminator. Or look into doing the 'preprocessing' directly in the stage via the Filter command. No clue on a DOS solution, but for UNIX or MKS you could pipe the file through 'tr' for example, to translate the pipe character on the fly. The stage would then read the stream output of the command as if it was a file and would be able to handle it correctly then.
Read up on the Filter option if it's something you're not familiar with. Basically, any command or series of commands you can send data through and which output that 'filtered' data to 'standard out' the stage can then read.
UNIX Style (LF)
DOS Style (CR LF)
None
One option would be to preprocess the file and replace the pipes with a 'normal' line terminator. Or look into doing the 'preprocessing' directly in the stage via the Filter command. No clue on a DOS solution, but for UNIX or MKS you could pipe the file through 'tr' for example, to translate the pipe character on the fly. The stage would then read the stream output of the command as if it was a file and would be able to handle it correctly then.
Read up on the Filter option if it's something you're not familiar with. Basically, any command or series of commands you can send data through and which output that 'filtered' data to 'standard out' the stage can then read.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Tell "them" to supply a file format that conforms to one of the industry standards!
Tilde-delimited and pipe-terminated is NOT an industry standard. It is a figment of someone's deranged imagination.
Tilde-delimited and pipe-terminated is NOT an industry standard. It is a figment of someone's deranged imagination.
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.