Thanks Jim. This looks like it would do the trick. I can't get it working with my code though. I started using this:
Code:
while IFS=',' read first rest
do
printf "%07d,%s\n" $first "$rest" >> newfile.csv
done< file.csv
which will pad the first field. But I would like to pad the second field. How do I get the code above to pad the second? Thanks much!
Here's the input file:
"100","100","ABC"
"100","200","ABC"
"100","300","ABC"
Here's the desired output:
"100","0000100","ABC"
"100","0000200","ABC"
"100","0000300","ABC"