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 thisan unknownnumber of lineswith worthless junkthat's breakingmy CSV parsingfoo,this,is,the,header,line,always,starts,with,foo[ legit records to follow ]Turn into thisfoo,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.
Delete lines from pattern match backwards
command line;sed;grep;csv
Per comments and further research, here's what ultimately worked for mesed -i '/^foo/,$!d' path/to/file