Our file has different record types. It is a text file with ASCII data. Delimiter is a non printable character.
I am trying to read the data in single column and then divide the records.
But when I am trying to read the data in single line, when I say view data I could not see the non printable characters (I mean they even doesn't appear as boxes).
Kindly give me your thoughts.
Using sequential file to read the data.
Unable to see the non printable characters
Moderators: chulett, rschirm, roy
Unable to see the non printable characters
Thank you,
Anu
Anu
Are you asking how to determine what character the delimiter is? From unix command line, this command will tell each character's value in hex. I suggest you run it on a small 1 or 2 line sample file.
Code: Select all
od -x file.txt
Choose a job you love, and you will never have to work a day in your life. - Confucius
Or:
Code: Select all
head -2 file.txt | od -x
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: Unable to see the non printable characters
No I am not asking about how to find what is the character.
Suppose in the file the data is delimited by ASCII 26, like A(ASCII 26)B, when I define single column in seq file stage and click on view data, I ma seeing AB in place of non printable character I don't see a box or anything.
Later I want to split that record into two columns in Transformer, How should I do that ? (Apart from doing that in the sequential file stage while reading the file..)
Suppose in the file the data is delimited by ASCII 26, like A(ASCII 26)B, when I define single column in seq file stage and click on view data, I ma seeing AB in place of non printable character I don't see a box or anything.
Later I want to split that record into two columns in Transformer, How should I do that ? (Apart from doing that in the sequential file stage while reading the file..)
Thank you,
Anu
Anu
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In the Transformer stage, use Field(InLink.Line, Char(26), 1, 1) and similar.
Performance tip: initialize stage variable to Char(26) and use the stage variable name as the second argument of the Field() function - that way the Char() function is evaluated only once.
Performance tip: initialize stage variable to Char(26) and use the stage variable name as the second argument of the Field() function - that way the Char() function is evaluated only once.
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.
Thanks Ray. It worked. Actually when reading the file before I was using \x1A, so in filed function I was trying with that and just 1c (I kind of know that this is wrong as the data may contain 1c) which are the hexadecimal values.
Thanks ssnegi for the alternative. But I wanted to do that in Datastage.
Thanks ssnegi for the alternative. But I wanted to do that in Datastage.
Thank you,
Anu
Anu