Sponsored Content
Top Forums Shell Programming and Scripting Convert special charachter ^C to new line Post 302387429 by vnag97 on Friday 15th of January 2010 05:51:29 PM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
base32::hex(n)							  Base32 encoding						    base32::hex(n)

__________________________________________________________________________________________________________________________________________________

NAME
base32::hex - base32 extended hex encoding SYNOPSIS
package require Tcl 8.4 package require base32::core ?0.1? package require base32::hex ?0.1? ::base32::hex::encode string ::base32::hex::decode estring _________________________________________________________________ DESCRIPTION
This package provides commands for encoding and decoding of strings into and out of the extended hex base32 encoding as specified in the RFC 3548bis draft. API
::base32::hex::encode string This command encodes the given string in extended hex base32 and returns the encoded string as its result. The result may be padded with the character = to signal a partial encoding at the end of the input string. ::base32::hex::decode estring This commands takes the estring and decodes it under the assumption that it is a valid extended hex base32 encoded string. The result of the decoding is returned as the result of the command. Note that while the encoder will generate only uppercase characters this decoder accepts input in lowercase as well. The command will always throw an error whenever encountering conditions which signal some type of bogus input, namely if [1] the input contains characters which are not valid output of a extended hex base32 encoder, [2] the length of the input is not a multiple of eight, [3] padding appears not at the end of input, but in the middle, [4] the padding has not of length six, four, three, or one characters, CODE MAP
The code map used to convert 5-bit sequences is shown below, with the numeric id of the bit sequences to the left and the character used to encode it to the right. The important feature of the extended hex mapping is that the first 16 codes map to the digits and hex characters. 0 0 9 9 18 I 27 R 1 1 10 A 19 J 28 S 2 2 11 B 20 K 29 T 3 3 12 C 21 L 30 U 4 4 13 D 22 M 31 V 5 5 14 E 23 N 6 6 15 F 24 O 7 7 16 G 25 P 8 8 17 H 26 Q BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category base32 of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
base32, hex, rfc3548 CATEGORY
Text processing COPYRIGHT
Copyright (c) Public domain base32 0.1 base32::hex(n)
All times are GMT -4. The time now is 08:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy