How do you split a file and keep the first line in each of the pieces?

How do you split a file and keep the first line in each of the pieces?
Answer
Line by line explanation:
  1. Capture the header to a variable named csvheader.
  2. Split the bigfile. …
  3. Find all smallfiles and insert the csvheader into the FIRST line using xargs and sed -i.
 

Tìm kiếm

Back
Top