Using AWK

Posted:
in Mac Software edited January 2014
I have wrote an AWK script and tested it using an English text file, as that is my native language.



However, I live and work in Germany and need to run the script on a German text file. The output is OK except where the word contains an umlaut (ö, ä or ü) and ß, which are replaced with question marks.



When I run the env command, the LANG variable is not set.



My first question is, if I set the LANG variable for Germany, will this force AWK to use German letters? If so, does anyone know what the value is for Germany?



The second question is, if setting the LANG variable is not the answer, what is?



Thanks in advance.



Alexei

Comments

  • Reply 1 of 2
    durandaldurandal Posts: 277member
    Hello Alexei,



    not sure about your first question, but I can help with the LANG value for Germany:



    Code:


    LANG=de_DE.UTF-8







    Quote:
    Originally Posted by Alexei Ladis View Post


    My first question is, if I set the LANG variable for Germany, will this force AWK to use German letters? If so, does anyone know what the value is for Germany?



    Best,

    durandal
  • Reply 2 of 2
    Thanks Durandal.



    I included this in my script, but it still did not work.



    Then I found out what the problem was.



    It does not work if I output to screen. This I can live with.



    However, if I redirect the output to a file, the characters are there.



    cheers



    Alexei
Sign In or Register to comment.