Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources: Active Threads
Viewing all articles
Browse latest Browse all 8411

Print only lines with a certain Character in column 1

$
0
0

I have a file that has a lot of lines.  I want to create a new file that has only those lines that have a certain character in the first column of each line.  If it isn't there skip that line.

File example

* some data here

    * more data but indented

    * more data stil

* some new data

So basically I want to only Print or create a new file that has the * in column 1 of this entire file and skip all the other lines that basically would be blank or null.   This list is variable so I can't just say print every 3rd line. 

What would be the best way to go about this?

 

Thank You

  Pappabees


Viewing all articles
Browse latest Browse all 8411

Trending Articles