I would like to ask you how can I add a set of strings containing three values each, one after the other, in the same file (e.g. CONV.inp)?
I would like to type N number of lines with the respective values like here:
...
5.834,-54.05,0
7.728,-10.35,0
7.796,-14.85,0
7.871,-4.85,0
9.397,7.09,0
...
The last 0 never change. I would be able to type the two values of each line, and only and only when I finish, typing a random letter to quit from the loop in bash.
...
echo -en '\n'
echo "1"
echo -en '\n'
read A
read B
echo "$A,$B,0" >> CONV.inp
echo -en '\n'
echo "2"
echo -en '\n'
read C
read D
echo "$C,$D,0" >> CONV.inp
echo -en '\n'
echo "3"
echo -en '\n'
read E
read F
echo "$E,$F,0" >> CONV.inp
...
Does anyone have an idea on how to implement a loop with these features?
Thanks in advance!
first_column,second_column,third_columntriples and then add the final zero with<input.txt sed -e 's/$/,0/'?