I have a CSV file that I need to parse, but the first n lines of this file are worthless garbage.
Fortunately, I know the proper header line starts with foo, and that every line before the first appearance of foo at position 0 can be deleted.
tl;dr How do I make this
an unknown
number of lines
with worthless junk
that's breaking
my CSV parsing
foo,this,is,the,header,line,always,starts,with,foo
[ legit records to follow ]
Turn into this
foo,this,is,the,header,line,always,starts,with,foo
[ legit records to follow ]
I am expecting a sed-powered response to be the right course of action, but any solution that I can run from the command line is sufficient.
sed '/^foo/,$!d'?sed -n '/^foo/,$p'