0

I got a csv file that contains some empty rows between the headers and other rows. For example:

Headers-----------------------------
Empty Rows------------A-------------
Empty Rows------------B-------------
Empty Rows------------C-------------
Data--------------------------------
Data--------------------------------

How to remove those empty rows (A,B and C) from CSV file using powershell?

I thought this would be an easy Google search but I can only find something like "remove lines from text file".

henrycarteruk
  • 12,708
  • 2
  • 36
  • 40
rock
  • 107
  • 5
  • 13
  • 1
    Which doesn't apply for what reason? A CSV file is a text file. As such solutions from e.g. [this](http://stackoverflow.com/questions/9223460/remove-empty-lines-from-text-file-with-powershell) question are solutions to this one. – Seth Feb 06 '17 at 13:37
  • @Seth I did not realise that they are the esame thing, I'll try that. – rock Feb 06 '17 at 13:41
  • You can open it in your text editor of choice and can read all the information within it without (major) problems. So it's a text file in comparison to a binary file which would look really wicked. Though it might be hard to interpret whatever is in that text file. – Seth Feb 06 '17 at 13:44

0 Answers0