PDA

View Full Version : Writing variables next to another into a file



Peter.Paul
November 26th, 2010, 05:48 PM
Hello Community,

I like to write two variables, separated by a tab into a file. I tried some things with echo and so, but it all did not work out. Can can help me with that?


voltage= awk 'BEGIN{total=0;} {total+=$1} END{printf (total/50)}' $1tail.txt
current= awk 'BEGIN{total=0;} {total+=$2} END{printf (total/50)}' $1tail.txt
thank in advance

bredsaal
December 22nd, 2010, 11:16 PM
Try this:

echo -e "$voltage\t$current" :-)