Sed accent


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sed accent
# 1  
Old 01-20-2009
Sed accent

Hi everyone !

I'd like to write a unix command for correcting all european accent errors in a document (spanish, german, french, danisch, etc )!

i need to do this for correcting my document :

sed -e 's/%2B/\ /g' -e 's/%25C9/É/g' doc1 > doc2

The first command is ok and change "%2B" into space
The second command don't work
i wanted to change "%25C9" into É Smilie

instead of "É" if have "√â" Smilie
i tried the command "recode" but it doesn't work...

In advance, thanks for your help Smilie
# 2  
Old 01-20-2009
Have you looked at the tr(1) command? It is probably bettered suited to what you want to do. I assume you are in a European locale such as ISO 8859-15 so you can see the corrected text.
# 3  
Old 01-20-2009
I think you're God !!!!!! Smilie
I am near the answer with your help, thanks

with the command :
tr "%25C9" "É"

the word change in : ÉÉÉÉÉthylometre
instead of : Éthylometre

how can i say that "%25C9" is just one word and not 5 differents words ??

My file is automaticaly generated by a cron, there is no charset i think
# 4  
Old 01-21-2009
I think the error is due to a double encode
i try this :

PHP Code:
php -'$t=file_get_contents("myfile.txt");echo utf8_encode(urldecode(urldecode($t)));' 
it works in 'head' but not in the entire document :

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 70106908 bytes) in Command line code on line 1... Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I am learning regular expression in sed,Please help me understand the use curly bracket in sed,

I am learning SED and just following the shell scripting book, i have trouble understanding the grep and sed statement, Question : 1 __________ /opt/oracle/work/antony>cat teledir.txt jai sharma 25853670 chanchal singhvi 9831545629 anil aggarwal 9830263298 shyam saksena 23217847 lalit... (7 Replies)
Discussion started by: Antony Ankrose
7 Replies

2. Shell Programming and Scripting

sed and awk giving error ./sample.sh: line 13: sed: command not found

Hi, I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :- ./sample.sh: line... (12 Replies)
Discussion started by: satishmallidi
12 Replies

3. AIX

Accent words file from windows

Hi guys, I'm having a issue with a windows file from, at first the file is readed like one big and extense line and the famous "Ctrl+V Ctrl+R" or "^M return carriage"... fixed with: perl -pe 'if ( s/\r\n?/\n/g ) { $f=1 }; if ( $f || ! $m ) { s/()\z/$1\n/ }; $m=1' $file_input > file_output ... (5 Replies)
Discussion started by: jockx
5 Replies

4. HP-UX

Problem with sftp for accent character files

Hi All, Following are the problems i am facing.Resolution for these would be highly commendable: a)I am trying to transfer files from my local C: directory to unix server using sftp. The problem is coming when files with accent characters are picked for transfer.These files are not... (6 Replies)
Discussion started by: destinykrishan
6 Replies

5. Shell Programming and Scripting

Remove spanish accent from file name

Hello All hope all fine, I have a question about spanish accents... I have in a redhat server, a lot of files with Ñ or Ú accent into the NAME of the file. So my question is: Is it possible to change this name but with a script...to change all the occurence in one shot. Exemple: cd... (2 Replies)
Discussion started by: ldiaz2106
2 Replies

6. AIX

Using "e" with "grave accent" on AIX

Hy, I have AIX5.3TL11 systems. Some are writing "é", but others are wrinting "^@" when I use the key "é" . how should I correct it ? Thanks for your help (3 Replies)
Discussion started by: astjen
3 Replies

7. Shell Programming and Scripting

Spanish accent symbol removed by sed

Hello All in a text file I have to replace some numeric code by a string. This is an exemple of the file: 000000001 LDR L ^^^^^nam^^2200169Ia^45e0 000000001 008 L 100604s9999^^^^xx^^^^^^^^^^^^000^0^und^d 000000001 022 L $$a0365-6675 000000001 090 L $$aBMA 1934-1937. 000000001 245... (1 Reply)
Discussion started by: ldiaz2106
1 Replies

8. Shell Programming and Scripting

sed over writes my original file (using sed to remove leading spaces)

Hello and thx for reading this I'm using sed to remove only the leading spaces in a file bash-280R# cat foofile some text some text some text some text some text bash-280R# bash-280R# sed 's/^ *//' foofile > foofile.use bash-280R# cat foofile.use some text some text some text... (6 Replies)
Discussion started by: laser
6 Replies

9. Shell Programming and Scripting

Issue with a sed one liner variant - sed 's/ ; /|/g' $TMP1 > $TMP

Execution of the following segment is giving the error - Script extract:- OUT=$DATADIR/sol_rsult_orphn.bcp TMP1=${OUT}_tmp1 TMP=${OUT}_tmp ( isql -w 400 $dbConnect_OPR <<EOF select convert(char(10), s.lead_id) +'|' + s.pho_loc_type, ";", s.sol_rsult_cmnt, ";", +'|'+ s.del_ind... (3 Replies)
Discussion started by: kzmatam
3 Replies

10. UNIX for Dummies Questions & Answers

accent in emacs

Hello, I try to insert charcheters with accent with emacs. It doesn't work. How can I do ? Thank you in advance (2 Replies)
Discussion started by: annemar
2 Replies
Login or Register to Ask a Question