Convert special charachter ^C to new line


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Convert special charachter ^C to new line
# 1  
Old 01-15-2010
Convert special charachter ^C to new line

Hi,

I have a file, which contains ^C or ^A characters from mainfrme system, it's dec 192 or octal 300 hex C0. I want to replace this character with new line.

I used commands, but it didn't worked.
Code:
 
tr '\o300' '\n' <t >t2
#or 
tr '\xC0' '\n' <t  > t2

Can somebody help me to do it?
[code]
-----------------------------------------------------------------------
VV100109000004000 CSS1001080001735 01/09/2010^A{1:F01
S33AXXX1653006546}{2:O9500007100109IRVTUS3NCXXX34498288201001090007N}{3:{10
8:CSS1001080001735}}{4:
:20:CSS1001080001735
:25:8900600268 :28C:5/1
:60F:C100108USD0,
:61:100108CD1039000000,NTRF021000018//DSP1001080119200
B/O,319916
:61:100108CD730407833,34NTRF5803563//FDF1001080038900
B/O:
:61:100108DD1039000000,S900100108026962//F2S1001087876400
O/B:ABIC/S33
:61:100108DD730407833,34NTRFDSP1001080018200//DSP1001080018200
BEN,CUS466087 OIS
:62F:C100108USD0,
:64:C100108USD0,
-}{5:{CHK:CE54EED6A6B2}}[B][COLOR=darkred]^C
ZZ100109000005000 ZZ100109000005001 01/09/2010 00:09:01:23^A{1:F01
30001109XXXX0000000010}{2:I21030003012XXXXN}{4:
:20:FX1742602
:30:100113
:21:1742602

Last edited by vnag97; 01-19-2010 at 11:49 AM.. Reason: use code tags please, ty
# 2  
Old 01-18-2010
Assuming the character is what you state and that this is a normal text file, your syntax for "tr" needs adjustment.

Code:
tr "\300" "\n" <t >t2

# 3  
Old 01-19-2010
removing Special character

Thank you it works.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Grep with special chars line by line

I have a file that includes strings with special characters, eg file1 line: 1 - special 1 line: = 4 line; -3 etc How can I grep the lines of file1 from file2, line by line? I used fgrep and egrep to grep a particular line and worked fine, but when I used: cat file1|while read line;do... (2 Replies)
Discussion started by: FelipeAd
2 Replies

2. Shell Programming and Scripting

Repeat line convert upper line

HI Guys, My Input :- R3 AV44 50 0 100 100 100 R3 AV44 1 0 100 100 100 R3 AV45 50 0 100 100 100 R3 AV45 0 3 100 100 100 R3 AV45S 50 0 100 100 100 R3 AV45S 0 4 100 100 100 Output :- R3 AV44 50 0 100 100 100 1 0 100 100 100 R3 AV45 50 0 100 100 100 0 3 100 100 100 R3 AV45S 50 0... (9 Replies)
Discussion started by: pareshkp
9 Replies

3. Shell Programming and Scripting

How to convert special characters?

Hi All, I have some text including Turkish characters and the 3rd party application that reads my file does not supporting this character set (at least, I have no control on it). So, I used below conversion for maximum character support but still have problems with "İ" and "Ş". Application... (5 Replies)
Discussion started by: mrcrowley
5 Replies

4. Shell Programming and Scripting

convert single line output to multiple line

Hi all, I have a single line output like below echo $ips 10.26.208.28 10.26.208.26 10.26.208.27 want to convert above single line output as below format. Pls advice how to do ? 10.26.208.28 10.26.208.26 10.26.208.27 Regards Kannan (6 Replies)
Discussion started by: kamauv234
6 Replies

5. Shell Programming and Scripting

Newline charachter in Ksh-Linux

Hello, I'm trying to create a muliti value shell variable with newlines inside it, So that I can read the values of that variable individually line by line, but KSH seems to be stripping my variable of newlines in LINUX, but UNIX its working fine. Here's Example : String =... (3 Replies)
Discussion started by: Sanju1236
3 Replies

6. Shell Programming and Scripting

delete line upto the nth occurence of a particular charachter.

hi all i want to delete a line upto a particular character. here is example. cp cms/images/wifi-zone.png i want to delete the line till . (cp cms/images/wifi-zone.) so the output wud be "png" only how can i do it? also please note down that dot (.) can also occur multiple... (12 Replies)
Discussion started by: kashifv
12 Replies

7. Shell Programming and Scripting

How to remove special characters from each line?

Hello, Is there a simpler way to remove special characters (color codes) from each lines in a log file? I use sed like in the example below but I think there should be a more simple way to achieve the same result: $ cat -vet file1 ^, , , , Maybe to convert the file somehow? ... (5 Replies)
Discussion started by: majormark
5 Replies

8. Shell Programming and Scripting

How to filer a line in special condition?

Hi, I hava log file which has the following output : Created RELEASE in dist/filename_release_1_0_20090210.zip Created RELEASE in dist/filename_release_1_1_20090210.zip Created RELEASE in dist/filename_release_1_3_20090210.zip Created RELEASE in... (6 Replies)
Discussion started by: bhaskar_m
6 Replies

9. Shell Programming and Scripting

convert special character like £

i had a shell script writing a xml file. I need to use "& # 163;" instead of "£", and replace others characters like: > to &gt; , and so on.. Anyone know how to convert the character automatically? my script as below: do # GET FEED REC SQL2="SELECT A.*, B.subject FROM feed_details A,... (1 Reply)
Discussion started by: cynnie
1 Replies

10. UNIX for Dummies Questions & Answers

Counting occurences of specific charachter in a file

Hi, I need to count the number of occurences of the character " in a file that contains huge number of records. What command could I use? Please specify in detail since I am new :| Thanks much. (3 Replies)
Discussion started by: GMMike
3 Replies
Login or Register to Ask a Question