I have the following script
awk \'{printf \"%s\", $1\"-\"$2\", \"}\' $a >> positions;
where $a stores the name of the fi
$a
Single pass approach:
cat "$a" | # look, I can use this in a pipeline! awk 'NR > 1 { printf(", ") } { printf("%s-%s", $1, $2) }'
Note that I've also simplified the string formatting.