Sponsored Content
Operating Systems HP-UX Replacing control characters in HPUX Post 302920788 by sembii on Sunday 12th of October 2014 11:46:10 PM
Old 10-13-2014
Replacing control characters in HPUX

Hello dears,

Please tell me how can I replace control characters with normal string. I have a file that contains normal string and ^A ^C control characters. I tried to use sed and awk without any luck.

Code:
sed 's/^A/foo/g' text > text1         //not worked
sed 's/\x01/foo/g' text > text1      //not worked
sed 's/\x001/foo/g' text > text1     //not worked
sed 's/\001/foo/g' text > text1       //not worked

Used grep to find ^A characters, but it's not finding. tr tool is working fine. But if I use tr it will completely remove all control characters from file. But I need to change control characters with normal string. How can I achieve this. Please help me

OS version - HPUX 11.31
Shell - /usr/bin/sh

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

printing control characters

using c-shell, does anyone know how to send control characters to the printer before the job? I need to set a printer to print in condensed mode HELP (1 Reply)
Discussion started by: mglinsk
1 Replies

2. UNIX for Dummies Questions & Answers

getting rid of control characters

how can i get rid of the control characters , ex. ^M, ^G, in a file? thanks... (2 Replies)
Discussion started by: apalex
2 Replies

3. UNIX for Dummies Questions & Answers

Remove control characters

Hi, When I do a man and save it into a file, I end up getting a lot of control characters. How can I remove them?? I tried this: /1,$ s/^H//g But I get an error saying "no previous regular expression". Can someone help me with this. Thanks, Aravind (5 Replies)
Discussion started by: aravind_mg
5 Replies

4. Shell Programming and Scripting

Search For Control M characters in files

Hi , I have special character control M in many of my files as below ersNet-Telnet-3.03/Makefile.PL100644 21166 144 612 7113770214 135 77 0ustar jayusers## -*- Perl -*-^M ^M use ExtUtils::MakeMaker qw(WriteMakefile);^M ^M WriteMakefile(NAME => "Net::Telnet",^M ... (4 Replies)
Discussion started by: Mohammed
4 Replies

5. Shell Programming and Scripting

screen control characters

Hi, Can anyone help me with controlling the cursor position from a shell script. Things like moving left,right,up,down etc Anyone have any ideas? (2 Replies)
Discussion started by: ajcannon
2 Replies

6. Shell Programming and Scripting

Urgent : Control Characters

Can somebody please help me with the query. ? I want a part of program of which should look for control characters in the flat file , when it finds it, displaying message that Control Characters found..! Please help me (1 Reply)
Discussion started by: iamnoone
1 Replies

7. Shell Programming and Scripting

Control Characters

Can somebody please help me with the query. ? I want a part of program of which should look for control characters in the flat file , when it finds it, displaying message that Control Characters found..! Please help me (13 Replies)
Discussion started by: iamnoone
13 Replies

8. Shell Programming and Scripting

sed replacing specific characters and control characters by escaping

sed -e "s// /g" old.txt > new.txt While I do know some control characters need to be escaped, can normal characters also be escaped and still work the same way? Basically I do not know all control characters that have a special meaning, for example, ?, ., % have a meaning and have to be escaped... (11 Replies)
Discussion started by: ijustneeda
11 Replies

9. UNIX for Dummies Questions & Answers

Control characters in UNIX

Hi, My files are showing some control characters in vi editor ^M ^@ and somtimes ^H I removed ^M with %s/^M//g command but how to represent ^@ and ^H e.g. for ^M it is hold ctrl then v and m.. Please help.. I am very new to unix.. (7 Replies)
Discussion started by: prabhat.diwaker
7 Replies

10. Shell Programming and Scripting

Control Characters

Hallo Team, I am trying to get rid of the dollar sign. I managed to remove all the other special characters but i am struggling with this one. -bash-3.2$ cat -e missing_revenue_20141112.csv|less|head BW0522168531211141180935668@196.23.110.141$ BW092218784121114-370120610@196.23.110.141$... (4 Replies)
Discussion started by: kekanap
4 Replies
yodlstriproff(1)					    Your Own Document Language						  yodlstriproff(1)

NAME
yodlstriproff - strip ASCII control characters SYNOPSIS
command | yodlstriproff > outputfile DESCRIPTION
The yodlstriproff program is a very simple tool to strip ASCII control characters off a stream, so that only `bare' ASCII is left. The stripped control sequences are ^H (backspace) followed by any character; this mechanism is used to underline or boldface text on terminals that support it. yodlstriproff is typically used with the Yodl converters yodl2msless and yodl2manless. SEE ALSO
yodl(1), yodlbuiltins(7), yodlconverters(1), yodlletter(7), yodlmacros(7), yodlmanpage(7), yodlpost(1), yodlverbinsert(1). BUGS
- AUTHOR
Frank B. Brokken (f.b.brokken@rug.nl), yodl__CurVers_.tar.gz _CurYrs_ yodlstriproff(1)
All times are GMT -4. The time now is 05:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy