in reply to Re: Replace first blank line in a text file with headers.
in thread Replace first blank line in a text file with headers.
perl -pi -le 's/^\s*$/Name, City, State, Zip/ if $.==1' filename.txt
edit: Sorry, forgot the -l (without it, the line is replace-inserted without newline, and the next line with data does not start at the beginning of the next line)
|
|---|