Page 1 of 1

Carriage return

Posted: Wed Feb 07, 2007 2:50 pm
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

Posted: Wed Feb 07, 2007 2:54 pm
by DSguru2B
Look into sed. You can apply sed as a filter command.

Posted: Wed Feb 07, 2007 2:57 pm
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.

Re: Carriage return

Posted: Wed Feb 07, 2007 2:59 pm
by kura
Did you try to use "DOS line delimiter option" in the sequential file stage

Posted: Wed Feb 07, 2007 3:19 pm
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.

Posted: Wed Feb 07, 2007 3:35 pm
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.

Posted: Wed Feb 07, 2007 3:49 pm
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.

Posted: Wed Feb 07, 2007 3:50 pm
by samsuf2002
use sed, by the way how do you extract your files ?

Posted: Wed Feb 07, 2007 4:08 pm
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.

Posted: Wed Feb 07, 2007 4:11 pm
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.