How to remove ctrl M or(^M) characters in file using Sequential File stage?

Answers were Sorted based on User's Feedback



How to remove ctrl M or(^M) characters in file using Sequential File stage?..

Answer / subbuchamala

1) In Sequential file, we have an option like 'filter'.
in the filter we can mention like:
sed 's/\^M//g' FileName.txt

or
2) we can do this in Before job routine(executeSH) and we can cal this in Seq file stage. here we can use UNIX command 'unix2dos fileName.txt'

Is This Answer Correct ?    13 Yes 0 No

How to remove ctrl M or(^M) characters in file using Sequential File stage?..

Answer / subhash (subbuchamala)

We can use these ways also to remove Control M Characters

tr -d '\r' < yourfile.txt > yourfile1.txt
mv yourfile1.txt yourfile.txt

or

Change the line terminator in Sequential File stage from
UNIX-style to DOS-style(it's a stage property).

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Data Stage Interview Questions

how to export or import the jobs in .ISX file

0 Answers  


What is exact difference between Parallel Jobs and server Jobs..

7 Answers   IBM,


what is the diff between sequential file and fileset stages?

3 Answers  


file1 1 2 3 4 file2 3 4 5 6 output should be in three targets T1 T2 T3 1 3 5 2 4 6 how to do this? can any one help? Thanks

5 Answers   Cap Gemini,


Why we use parameters instead of hard code in datastage.

2 Answers   IBM,






How can remove duplicates in a file using UNIX?

3 Answers   Cap Gemini,


What is a ds designer?

0 Answers  


What are some prerequisites for datastage?

0 Answers  


What is the difference between server job and parallel jobs?

0 Answers  


hi All, i have one scenario like if source--->transformer-->2 target sequential files the 1 st target sequential file is loads the data from source and 2nd target sequntial file contain the 1st target total record count,and file name of 1 st target seq file and timestamp seperated by delimeter for example if source have 10 record the 1st target seq file hav 10 records and 2nd target seq file example 10|xyz.txt|20101110 00:00:00 could you please help me out how can i implement in datastage job.

4 Answers   IBM,


What is the difference between hashfile and sequential file?

0 Answers  


30 jobs are running in unix.i want to find out my job.how to do this?Give me command?

3 Answers  


Categories