Mansour Al Akeel wrote: > I am not sure if this will do it for you. > > cat sample.txt | tr ',' '.' | awk '{ out="fl_gr"$1"mw.txt" ; if ($2 == > 2) out="fl_gr"$1"wm.txt" ; $1=$2=""; print $0 > out}'
Wow, what a short line of code, and to my amateur eyes it seems to contain everything relevant. I tried it an a tab-delimited .dat file (as I unterstand that it transfers commas to dots - and as Max correctly warned me, the generated .csv are anything but comma-seperated...) Running the comand results in: $ cat format.dat | tr ',' '.' | awk '{ out="fl_gr"$1"mw.txt" ; if ($2 ==2) out="fl_gr"$1"wm.txt" ; $1=$2=""; print $0 > out}' awk: syntax error at source line 1 context is { out="fl_gr"$1"mw.txt" ; if ($2 ==2) out="fl_gr"$1"wm.txt" ; $1= $2=""; print >>> ? <<< awk: illegal statement at source line 1 Hm. Linus --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---