Skip to content

Instantly share code, notes, and snippets.

@scwood
Created October 3, 2017 15:02
Show Gist options
  • Select an option

  • Save scwood/f0ed962c7c4b0b82eaa74efa07881476 to your computer and use it in GitHub Desktop.

Select an option

Save scwood/f0ed962c7c4b0b82eaa74efa07881476 to your computer and use it in GitHub Desktop.
Append output to column of file
touch output.csv # file with the end result
for i in {1..10}; do # replace with your "for every file loop"
sh ./program.sh | tr ' ' '\n' > tempfile1 # program.sh is your software, we pipe it into tr to split it into a column
paste -d ',' tempfile1 output.csv > tempfile2 # paste the column with a delimeter to a tempfile
mv tempfile2 output.csv # clean up the tempfiles on every iteration
rm tempfile1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment