Need help to Rplace '' character in Unix.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help to Rplace '' character in Unix.
# 1  
Old 03-03-2010
Need help to Rplace '' character in Unix.

I get file having ''character in it.In Unix this character is shown as '^Y'.

for test purpose i used following command

Code:
cat test | sed -e "s/^C^Y/ /g"

The contents of test fie are
Code:
Ashish^YisCool

and output shown was AshishisCool.
But when i redirect the output into someother fle i got the same data as in test file.

Please let me know if this can be done by any other command.

Thanks in advance

Last edited by radoulov; 03-03-2010 at 07:22 AM.. Reason: Use code tags, please!
# 2  
Old 03-03-2010
Cat will not print the control characters . So to view the control characters you have to use the option -v in cat.Then try what you want . Otherwise post the file which having that particular character.
# 3  
Old 03-03-2010
Rule 5
Quote:
(5) Search the forums database with your keywords before asking.
replace invalid characters
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to convert \n character to newline in UNIX.

I have a variable like below: str1="10.9.11.128\n-rwxr-xr-x user1 2019-12-29 17:53 /var/branch/custom/tg.xml 286030210\n10.9.12.129\n-rwxr-xr-x user1 2019-12-29 17:53 /app/branch/custom/tg.xml 286030210\n10.9.20.130\n-rwxr-xr-x user1 2019-12-29 17:53 /web/branch/custom/tg.xml 286030210" I... (8 Replies)
Discussion started by: mohtashims
8 Replies

2. Shell Programming and Scripting

Character count in UNIX!

Hi, I am Beginner in writing shell scripting. I have tried to get the character count using wc command. But it is not giving the correct result. Could any one please tell me the reason? $ cat k.ksh Shell scripting The character count should be 15 but it is displaying as 16 when i use... (8 Replies)
Discussion started by: nikesh29
8 Replies

3. Shell Programming and Scripting

How to remove ^I character from a UNIX file ?

Hi When i used :set list in vi , i have seen a lot ^I characters in my file. Could anyone please help me how to remove this characters ? Issue : When i used awk to combine two file (one of the file has ^I characters) then my output is different than what am expecting, one of column being... (2 Replies)
Discussion started by: rakeshkumar
2 Replies

4. Shell Programming and Scripting

Unix-problem of New line character

Hi All, "Please read the below information carefully." i have tried the below code for counting the number of lines present in text file ignoring blank lines #! /bin/bash clear rdCount=0; while read myline do if ; then echo "line is empty" else echo $myline let... (10 Replies)
Discussion started by: aish11
10 Replies

5. Shell Programming and Scripting

control M character in unix file

in a file we are getting control character in a file , is there any way that they can be removed once we have the file for eg. BEGIN-PROCEDURE INITIALIZE ^M LET #row_count = 0^M ^M ^M (2 Replies)
Discussion started by: lalitpct
2 Replies

6. Programming

Quote character Unix to Oracle

Hi, I'm trying to load data into an Oracle DB. A Perl script opens a file that was created with vi on Unix, connects to the DB and inserts data. All characters (some of which are special characters) in my data can be loaded except for one: ' It turns into something else in the DB. The... (3 Replies)
Discussion started by: TheG
3 Replies

7. Shell Programming and Scripting

Cleanup Weird character in Unix

Hi, I have a pipe delimited file and I am running into an issue where a field is having some weird character and I am not able to clean it up. It is 2nd field and the weird character is M- . See below. cat -v test.dat 02169| M- PATRICKM- MCALEER |Y 01318| M- LARRYM- PETERSON |Y 30319|... (5 Replies)
Discussion started by: msalam65
5 Replies

8. Shell Programming and Scripting

Unix character set problem

Hi All, We are getting file into our unix box with multibyte characters. When we tried to view the file the record looks like this Frédéric Actually the data sent to us is Frédéric --> my locale charmap of unix is set to UTF8 only ... but still i am getting this problem. I... (6 Replies)
Discussion started by: sandeeppvk
6 Replies

9. UNIX for Advanced & Expert Users

Unix wildcard character question

1. Is . wildcard? , the documented wildcard are "*", "?", and "" . seems mean everything, the follwing cmd will copy everything cp -r /tmp/test1/. /tmp/test2/ However it doesn't work for rm, why? $ ls -a . .. .a .aa aa t2 $ rm -rf . $ ls -a . .. .a .aa ... (3 Replies)
Discussion started by: honglus
3 Replies

10. Programming

character set conversion in unix C

Hi, Could anybody explain how to change the character set of a particular string in C in unix. we are using HP-UX as OS. We require to change the input string which is in cp1250 format to utf-8. A sample code would help. Thnx in advance (1 Reply)
Discussion started by: gucho
1 Replies
Login or Register to Ask a Question