help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] how to translate one file


From: lina
Subject: [Help-bash] how to translate one file
Date: Mon, 02 Jan 2012 23:46:08 +0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16

Hi,

I have one file like

a 1
b 2
c 3

and the last line of the file like :

abc

I wish to translate it to
1 2 3


Here is the script I wrote, but choked by the crucial step of translation,

#!/bin/sh

for f in dm_1.xpm ### Here I used for cause I have 10 *.xpm files, and they have different dictionary.
do

awk '{if(NF==7) print $1, $6}' $f | tr -d '"' | sed 's/[a-Z]/\$&\=/g'

tail -1 $f | tr -d '"'

#echo ${f%.*}

done

I attached the file below,

https://docs.google.com/open?id=0B93SVRfpVVg3ZmFkOTNmYWEtNjJlNC00ZjhjLTlmODAtMDQ5ZmIzY2M1Y2I1

BTW, Thanks all for helping me in the past, for some questions I asked, I still need time to digest about your reply. If none immediate response, it did not mean I did not care about the questions I asked. It means I cared both my questions and your reply. Thanks again,

Best regards,





reply via email to

[Prev in Thread] Current Thread [Next in Thread]