Identify File with ControlM Characters


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Identify File with ControlM Characters
# 1  
Old 11-12-2009
Identify File with ControlM Characters

Dear Members,

I have a file which contains ControlM characters in it.

I need a command by the means of which i should be able to identify if a file has controlM characters.

How can this be achieved.

Thanks
Sandeep
# 2  
Old 11-12-2009
grep can do that...

Code:
grep '^M' filename

Note: type CTRL+V CTRL+M to get the above.
# 3  
Old 11-12-2009
^M comes when we hold ctrl V and M together. This can be done in vi editor.
How do i print ^M in my shell script.
# 4  
Old 11-12-2009
Code:
CR=`echo '\0015'`        # Carriage Return
grep "${CR}" filename

You could say pipe the grep to "wc" and count the hits.
# 5  
Old 11-12-2009
Quote:
Originally Posted by methyl
Code:
CR=`echo '\0015'`        # Carriage Return
grep "${CR}" filename

You could say pipe the grep to "wc" and count the hits.

Thanks methyl,

Your code is working perfectly fine.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Exit1 not to report failure in controlM

HI Team, I running below script from controlM and job is reporting as failure everyday so i tried to change the if exitstatus=1 (send only email) but not to end as a job is failed. can you let me know where i have to change this script to make the script not to fail but instead send email and... (3 Replies)
Discussion started by: Mi4304
3 Replies

2. Shell Programming and Scripting

Regex to identify illegal characters in a perso-arabic database

I am working on Sindhi: a perso-Arabic script and since it shares the Unicode-block with over 400 other languages, quite often the database contains characters which are not wanted: illegal characters. I have identified the character set of Sindhi which is given below: For clarity's sake, each... (8 Replies)
Discussion started by: gimley
8 Replies

3. Shell Programming and Scripting

Identify missing file

I am on linux and I am supposed to receive 3 files. If any of the files are not received I need to identify the missing file and throw it out in a variable. I have put in something like this if ] then echo "file $file1 was found" else echo "ERROR: file $file1 was not found!!!"... (8 Replies)
Discussion started by: dsravanam
8 Replies

4. Shell Programming and Scripting

Unable to identify the special characters beyond the range of "[\x80-\xFF]"

I want to filter out the special character whose ascii value doesn't fall within the range "" . Example:� or Ć. So in that case is there any defined range which will filter out this characters. I can filter those which falls withing "" . Need to filter those special chracter which doesn't... (14 Replies)
Discussion started by: Abhijit Sen
14 Replies

5. Shell Programming and Scripting

Identify extended ascii characters in a file

Hi, Is there a way to identify the lines in a file having extended ascii characters and display the same? For instance I have a file abc.txt having below data aaa|bbb|111|This is first line aaa|bbb|222|This is secõnd line aaa|bbb|333|This is third line aaa|bbb|444|This is foùrth line... (3 Replies)
Discussion started by: decci_7
3 Replies

6. Shell Programming and Scripting

Compare large file and identify difference in separate file

I have a very large system generated file containing around 500K rows size 100MB like following HOME|ALICE STREET|3||NEW LISTING HOME|NEWPORT STREET|1||NEW LISTING HOME|KING STREET|5||NEW LISTING HOME|WINSOME AVENUE|4||MODIFICATION CAR|TOYOTA|4||NEW LISTING CAR|FORD|4||NEW... (9 Replies)
Discussion started by: jubaier
9 Replies

7. Shell Programming and Scripting

how do I identify files with characters beyond a certain range.

I have a directory with hundreds of files that can not have data pass column 80. I do not know of way to combine "grep" and "cut" command. I tried: cat * | cut -c 81-120 |pg but it only shows me the line, not the file name. Any help would be appreciated. Been on this all... (3 Replies)
Discussion started by: kcsunsun01dev
3 Replies

8. Shell Programming and Scripting

Identify records having junk characters in unix

Hi Friends, I need to have a command in Unix which output all teh records havingg junk characters in a file.... I know a command cat -tv <Filename> which opens the file and we can check for any junk character in it. But my requirement is to fetch ONLY THOSE records having junk characters.... (6 Replies)
Discussion started by: sureshg_sampat
6 Replies

9. UNIX for Advanced & Expert Users

sudo comand with ControlM

I'm trying to change the user Id that the script is running under. I tried the sudo comand but the job was submitted under ControlM and it seems that controlM is not allowing the user id to change. I have included the job output below. The sudo comand was suppose to set the user id to "DWSOLAP"... (3 Replies)
Discussion started by: u156531
3 Replies

10. Shell Programming and Scripting

Identify type of file

hi all, i have the next question: how can i identify the type of a file? . I'm working in Unix (Solaris 5.7) and i would like identify if a file is or not is a "flat file". I need have a program what separates the flat file in a directory, and the excel file in another directory. I must get... (1 Reply)
Discussion started by: DebianJ
1 Replies
Login or Register to Ask a Question