Hi,
I am complete newbie, as some of you know already...
I have a file which contains two columns, separated by space. First column has english words and second column has words in french, like:
house maison
meal repas
sea mer
water eau
etc...
I use this code to run the translation:
echo "Enter the word in english:"
read string
echo "Same word in french is:"
awk ' { if ($1 == word)
print $2 }' word="$string" lang_words.txt
How can I modify this to read the whole sentence (made up of words in lang_words.txt file only)
For example, I would be prompted with:
echo "Enter the sentence in english:"
followed by:
echo "Same sentence in french is:"
This is "word for word" translation, so it should be fairly easy, but it is still beyond me.
Any ideas on how this would work?
I am complete newbie, as some of you know already...
I have a file which contains two columns, separated by space. First column has english words and second column has words in french, like:
house maison
meal repas
sea mer
water eau
etc...
I use this code to run the translation:
echo "Enter the word in english:"
read string
echo "Same word in french is:"
awk ' { if ($1 == word)
print $2 }' word="$string" lang_words.txt
How can I modify this to read the whole sentence (made up of words in lang_words.txt file only)
For example, I would be prompted with:
echo "Enter the sentence in english:"
followed by:
echo "Same sentence in french is:"
This is "word for word" translation, so it should be fairly easy, but it is still beyond me.
Any ideas on how this would work?