Forum Discussion
niazstinu
Feb 08, 2021Brass Contributor
How to Read Certain line in Powershell
How can I read line number 10 from a text file ?1
There are multiple way
The easiest is Load the file and select the line you need as its an array
$x=Get-content C:\MyFile.txt
$x[9]
Or you can use this way
$x | select -First 1 -Skip 9
2 Replies
- farismalaebIron Contributor
There are multiple way
The easiest is Load the file and select the line you need as its an array
$x=Get-content C:\MyFile.txt
$x[9]
Or you can use this way
$x | select -First 1 -Skip 9
- niazstinuBrass Contributor