Avatar of H
H
 asked on

StreamReader - line of data is displayed on the console

Hi,

If a csv has column names, I am using the reader to read the first row of data and not the column headers row. I'm using the following statement:

$reader = New-Object System.IO.StreamReader($File)
if ($ColumnNames -eq 'True') {$reader.ReadLine()}

The issue I'm having, is that the line of data is is then displayed on the console. Is there a way to run this statement without having the line displayed?


Thanks,
Helen
Powershell

Avatar of undefined
Last Comment
H

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
oBdA

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
H

ASKER
Brilliant, thank you oBdA. :)
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck