characters ô ö à é è


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting characters ô ö à é è
# 1  
Old 04-19-2006
characters ô ö à é è

Hi!

I have a file with some characters with accent.

I don't find the solution to translate
ô ö as o
à as a
é è as e
ç as c

With the command tr or sed?
I can't write sed 's/ô/o/g' because the copy/paste ô don't work.

Thanks!

Last edited by Castelior; 04-19-2006 at 11:05 AM..
# 2  
Old 04-19-2006
Well ... Unicode is designed to make this easy in certain environments.

For example, the following works on my system (bash):

Code:
cbkihong@cbkihong:~$ LC_ALL=en_US.UTF-8 \ 
iconv -f 'iso-8859-15' -t 'utf-8' /tmp/testfile_ISO8859_15.txt \
| sed -e s/[$'\303\264'$'\303\266']/o/g -e s/$'\303\240'/a/g

I don't find the solution to translate 
 o o as o
 a as a
 é è as e
 ç as c
 
 With the command tr or sed? 
 I can't write sed 's/o/o/g' because the copy/paste o don't work.

(The \ are line continuation)

I copied the content of your post in the file testfile_ISO8858_15.txt with the ISO-8859-15 character set, which supports all the accented characters you listed. The command converts the file into Unicode on the fly (if you have the source files in UTF-8, you can save this step!), then make use of the bash $'\nnn' syntax to refer to the character by code without literally typing them out.

Here I have the first two done for you as an example. If you decide on expanding it you should be able to complete the rest. Of course you can redirect the output to a file, and/or convert the encoding as you prefer.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Outputting characters after a given string and reporting the characters in the row below --sed

I have this fastq file: @M04961:22:000000000-B5VGJ:1:1101:9280:7106 1:N:0:86 GGGGGGGGGGGGCATGAAAACATACAAACCGTCTTTCCAGAAATTGTTCCAAGTATCGGCAACAGCTTTATCAATACCATGAAAAATATCAACCACACCA +test-1 GGGGGGGGGGGGGGGGGCCGGGGGFF,EDFFGEDFG,@DGGCGGEGGG7DCGGGF68CGFFFGGGG@CGDGFFDFEFEFF:30CGAFFDFEFF8CAF;;8... (10 Replies)
Discussion started by: Xterra
10 Replies

2. Shell Programming and Scripting

Remove first 2 characters and last two characters of each line

here's what im trying to do. i have a file containing lines similar to this: data.txt: 1hsRmRsbHRiSFZNTTA1dlEyMWFkbU5wUW5CSlIyeDFTVU5SYjJOSFRuWmpia0ZuWXpKV2FHTnRU 1lKUnpWMldrZFZaMG95V25oYQpSelEyWTBka2QyRklhSHBrUjA1b1kwUkJkd3BOVXpWM1lVaG5k... (5 Replies)
Discussion started by: SkySmart
5 Replies

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

4. Shell Programming and Scripting

Replace special characters with Escape characters?

i need to replace the any special characters with escape characters like below. test!=123-> test\!\=123 !@#$%^&*()-= to be replaced by \!\@\#\$\%\^\&\*\(\)\-\= (8 Replies)
Discussion started by: laknar
8 Replies

5. Shell Programming and Scripting

Cut the last 15 characters off

Hi Gurus, I am trying to execute the below command. However the output shows the value + path of the folder where the command is being executed. But I am only interested in the value but not the path. du -hs /aps/inf/SeLogs when I execute the above command, output is 32G... (5 Replies)
Discussion started by: svajhala
5 Replies

6. Shell Programming and Scripting

How to replace characters with random characters

I've got a file (numbers.txt) filled with numbers and I want to replace each one of those numbers with a new random number between 0 and 9. This is my script so far: #!/bin/bash rand=$(($RANDOM % 9)) sed -i s//$rand/g numbers.txtThe problem that I have is that it replaces each number with just... (2 Replies)
Discussion started by: hellocatfood
2 Replies

7. HP-UX

Non-printable characters

I have been using OKI data Microline printers; models 590 and 591 to print a bar code using the following escape sequence: \E^PA^H^C00^D^C^A^A^A\E^PB^H The escape sequence is stored in a unix file which is edited using vi. Now, we are considering Microline printer model 395C and the bar code... (3 Replies)
Discussion started by: Joy Conner
3 Replies

8. Shell Programming and Scripting

get certain characters in a string

Hi Everyone, I have a.txt 12341" <sip:191@vo.my>;asdf=q" 116aaaa<sip:00091@vo.my>;penguin would like to get the output 191 00091 Please advice. Thanks (4 Replies)
Discussion started by: jimmy_y
4 Replies

9. UNIX for Dummies Questions & Answers

How to remove Characters before '~'

Hi, I am having a file which contains records as follows: DETAIL_KEY~12344|ACTIVE_PASSIVE~Y|AVG_SIZE_OF_RESPONSE~123123131 DETAIL_KEY~12344|ACTIVE_PASSIVE~Y|AVG_SIZE_OF_RESPONSE~123123131 DETAIL_KEY~12344|ACTIVE_PASSIVE~Y|AVG_SIZE_OF_RESPONSE~123123131... (4 Replies)
Discussion started by: Amey Joshi
4 Replies

10. Shell Programming and Scripting

Contol M (^M) characters

Is there a way to recursively find scripts/files with ^M characters embedded in them Usually the case is when a file is saved on unix but in dos/windows format it ends up have ^M characters at the end of each line. Please let me know if there is a way to recursively find them. (3 Replies)
Discussion started by: Anubhav
3 Replies
Login or Register to Ask a Question