Simple but useful. The sample file is “,” delimited.

cat sample
3232,32332,54545,34
3233,45645,23233,23
1211,1212,4343,434
3434,121121,121,33

If I have to add the line number as the first field. Then

awk '{$1=$1; print NR,$0}' sample
1 3232,32332,54545,34
2 3233,45645,23233,23
3 1211,1212,4343,434
4 3434,121121,121,33

If I have to change the field separator of the above file from “,” to “|” (can also be done using ‘tr’) and have to add the line number as the first field. Then

awk 'BEGIN{FS=",";OFS="|"} {$1=$1; print NR,$0}' sample
1|3232|32332|54545|34
2|3233|45645|23233|23
3|1211|1212|4343|434
4|3434|121121|121|33