Skip to content

Instantly share code, notes, and snippets.

@luiscape
Created June 28, 2016 14:56
Show Gist options
  • Save luiscape/5da2796b8d9a38cf60a4b6f0d4e3868c to your computer and use it in GitHub Desktop.
Save luiscape/5da2796b8d9a38cf60a4b6f0d4e3868c to your computer and use it in GitHub Desktop.
#
# This file contains a shell script
# that will add a header to a TXT file
# without a header. Headers make it easier
# to navigate files. We like them.
#
# Original solution by: http://stackoverflow.com/questions/13402809/insert-a-line-in-csv-file
#
FILE=file_without_header.txt
sed -i.bak 1i"HEADER1,HEADER2,HEADER3" \
$FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment