Selecting only specific columns from a file in unix
Moderators: chulett, rschirm, roy
Selecting only specific columns from a file in unix
Hi
I have a file available in UNIX box. There are many columns in it. I want datastage to read only selected columns from the file. How can this be done? It is tedious process to load the metadata of the file to Sequential file stage. Please post me the answer as soon as possible
I have a file available in UNIX box. There are many columns in it. I want datastage to read only selected columns from the file. How can this be done? It is tedious process to load the metadata of the file to Sequential file stage. Please post me the answer as soon as possible
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Re: Selecting only specific columns from a file in unix
as soon as possibleswerajan wrote:Please post me the answer as soon as possible
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Sainath beat me to it.... But I'll add some information - You can declare the whole line as one VarChar() field and parse out what you need instead of entering a lot of column metadata.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
I'll let Sainath assist you further on this thread, now that the two of you have hit it off so well.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
swerajan - most of the participants on this forum are not native English speakers, so using "text-speak" or "chatspeak" with lots of cryptic abbreviations is not good and certainly not professional. Likewise, this is a volunteer forum and thus the response to your request for immediate and expedited service was not well received.
Sequential files need to be read completely by the system in any case, even if only one field is to be processed. Thus your most efficient method will be to declare the field metadata correctly. Second best is to use one column and then a transform stage to parse out the part that you want.
In the words of the author Robert Heinlein : "TANSTAAFL".
Sequential files need to be read completely by the system in any case, even if only one field is to be processed. Thus your most efficient method will be to declare the field metadata correctly. Second best is to use one column and then a transform stage to parse out the part that you want.
In the words of the author Robert Heinlein : "TANSTAAFL".
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
As noted, you cannot 'read selective columns' from sequential media, it's not in its nature. Also, I wouldn't call 40 columns 'many' or too many to make it any kind of difficult to get the metadata right. Sheesh. How long does it take to import the metadata for the file and then load it into the job? Moments. Sure, you may need to do a little typing if the file does not contain a header record but it's worth the small amount of effort so you have the proper metadata.
In the time you've been here or futzed around trying to find something 'easier' you could have done it the right way and have moved on.
In the time you've been here or futzed around trying to find something 'easier' you could have done it the right way and have moved on.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers