Carriage return

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
kashif007
Premium Member
Premium Member
Posts: 216
Joined: Wed Jun 07, 2006 5:48 pm
Location: teaneck

Carriage return

Post by kashif007 »

Hi
how do i remove carrier return problem from the data which i am reading in an excel sheet. I saved the excel sheet in tab delimited format but i cannot read the data properly which has carriage return on it. the carriage return becomes a new line in datastage, which is not correct.

Can anyone suggest what do i do?

Thanks
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Look into sed. You can apply sed as a filter command.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If the <CR> is at the end of each line, then you've got a DOS formatted file. If you tell the Sequential File stage that, it will read it properly.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kura
Participant
Posts: 21
Joined: Sat Mar 20, 2004 3:43 pm

Re: Carriage return

Post by kura »

Did you try to use "DOS line delimiter option" in the sequential file stage
kashif007
Premium Member
Premium Member
Posts: 216
Joined: Wed Jun 07, 2006 5:48 pm
Location: teaneck

Post by kashif007 »

when i save the excel sheet into a tab delimited file the carrier return becomes a new line in the flat file and i dont have a carrier return in that format rather its a new line. Can you suggest what do i do to this.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

You might have to get rid of these extra "new lines".
As told above use sed in the filter command to remove them.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
kashif007
Premium Member
Premium Member
Posts: 216
Joined: Wed Jun 07, 2006 5:48 pm
Location: teaneck

Post by kashif007 »

can you tell me the exact command that i use because i do not see
CTRL+M symbol in my file. It just comes to the new line and never has the carrier return box symbol.
samsuf2002
Premium Member
Premium Member
Posts: 397
Joined: Wed Apr 12, 2006 2:28 pm
Location: Tennesse

Post by samsuf2002 »

use sed, by the way how do you extract your files ?
hi sam here
kashif007
Premium Member
Premium Member
Posts: 216
Joined: Wed Jun 07, 2006 5:48 pm
Location: teaneck

Post by kashif007 »

I get the data in the form of spreadsheet which I need to read in datastage in a tab delimited file. I understand that I have to use SED but I dont see the ^M in my unix file. How will the SED work if i dont have it in my file.

Excel =>(save as tab delim) => Flat => Unix(no ^M)=>cannot use SED
sheet File (found)

I hope you understand this.
kashif007
Premium Member
Premium Member
Posts: 216
Joined: Wed Jun 07, 2006 5:48 pm
Location: teaneck

Post by kashif007 »

I get the data in the form of spreadsheet which I need to read in datastage in a tab delimited file. I understand that I have to use SED but I dont see the ^M in my unix file. How will the SED work if i dont have it in my file.

Excel sheet =>(save as tab delim) => Flat file => Unix(no ^M not found)=>cannot use SED

I hope you understand this.
Post Reply