Transforming a delimited file into a non delimited file
Moderators: chulett, rschirm, roy
Transforming a delimited file into a non delimited file
I need to take a delimited file with four columns and transform it into a nondelimited, one field file. Any ideas?
A 'nondelimited one field file' could also be generated as a 'Fixed Width' file simply by checking that option. Same thing. You'll still need to set the quote character to '000'.
Or as noted, specifically concatenate all fields into one big one.
Or as noted, specifically concatenate all fields into one big one.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
A non delimited one field file, yes.
A fixed width file, i am not too sure about that.
If thats what the OP wants then he has to make sure that if a field is defined as length 10 and an incoming value has only 8 bytes, he needs to cat 2 extra spaces to it to make it a truely fixed width file. A little bit more effor for a fixed width file than just setting the delimiter to '000'
A fixed width file, i am not too sure about that.
If thats what the OP wants then he has to make sure that if a field is defined as length 10 and an incoming value has only 8 bytes, he needs to cat 2 extra spaces to it to make it a truely fixed width file. A little bit more effor for a fixed width file than just setting the delimiter to '000'
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
No, not necessarily... a fixed width file can 'fix' things itself just fine. Using 'char' for the character types helps tremendously, for example...DSguru2B wrote:A non delimited one field file, yes.
A fixed width file, i am not too sure about that.
If thats what the OP wants then he has to make sure that if a field is defined as length 10 and an incoming value has only 8 bytes, he needs to cat 2 extra spaces to it to make it a truely fixed width file. A little bit more effor for a fixed width file than just setting the delimiter to '000'
Give it a shot before you pass judgement, it can be as simple as checking the option.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
It really depends on what the OP needs. If the fields can be strung together willy-nilly, each piece picking up where the previous piece ends, then all this 'concatenation' advice is fine.
If the fields need to be of a certain consistant size, starting and ending in consistant positions with no delimiters between them, that is by definition a fixed width file. And if you build one by padding and concatenating the fields yourself, you are taking the wrong approach.![Wink :wink:](./images/smilies/icon_wink.gif)
If the fields need to be of a certain consistant size, starting and ending in consistant positions with no delimiters between them, that is by definition a fixed width file. And if you build one by padding and concatenating the fields yourself, you are taking the wrong approach.
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Very true. I, just wasnt sure, if datastage padds spaces to honor the length on its own just by specifying the sql type as 'char'. Thats why my concern to do it explicitly.
But as i told you before, your officially my mentor.
Learn something new from you every day.
But as i told you before, your officially my mentor.
![Wink :wink:](./images/smilies/icon_wink.gif)
Learn something new from you every day.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
You can specify how to pad, either globally or on an individual field level. Some you may want space filled, others zero filled. It's all in there...
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle