I have a csv file with n different columns, an example is attached below. How can I output the entire csv file using an awk (to be used by a dbms using STDIN). I've tried
awk -v RS='
' '{print $1 ',' $1 + 1} file
but this wraps around causing the first column to also be printed at the end. Also is there a way to change the file ending when reading the csv so that it outputs in the form '
'. Preferably looking for a one-liner.
1, 20, Is
2, 12, this
3, 18, minimal
4, 21, enough
and the output should be
1, 20, Is
2, 12, this
3, 18, minimal
4, 21, enough
printed in terminal with line breaks and commas in the same position using awk
(no cat
).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…