[ale] tcsh script question
Jim Philips
briarpatchkid at bellsouth.net
Wed Aug 9 20:29:44 EDT 2006
I'm going nuts with this. We have a file coming in that has characters with
diacritical marks, such as accented vowels. I created several substitution
routines that work fine from the command line, but when placed inside of a
larger shell script, they bomb. In one case, the character is simply deleted.
In another, it gets replaced with /211. Here is my routine:
# Convert special characters
cp ${FILE} ${FILE}.ORIG
sed -e s/\\321/N/g -e s/\\361/n/g -e s/\\301/A/g -e s/\\341/a/ -e
s/\\311/E/g
-e s/\\351/e/g -e s/\\315/I/g -e s/\\355/i/g -e s/\\323/O/g -e s/\\363/o/g -e
s/\\332/U/g -e s/\\372/u/g -e s/\\335/Y/g -e s/\\375/y/g
# cat ${FILE}.ORIG | tr '[\321,\361,\301,\341,\311,\351,\315,\355,\323,\363,
\332,\372,\335,\375]' '[N,n,A,a,E,e,I,i,O,o,U,u,Y,y]' > ${FILE}
Don't laugh. I'm not an experienced writer of these things. The character I'm
replacing so far is \351 (accented e). Any ideas as to what may work? The OS
is Sun Solaris.
More information about the Ale
mailing list