View Single Post
Old 09-16-2007   #3 (permalink)
Faisal


 
 

Re: Count the number of Columns/rows in a CSV file....

Excellent, thanks for the help!

"Kiron" wrote:
Quote:

> # assign csv data to a variable (optional)
> $csv = import-csv data.csv
>
> # column count
> ($csv | get-member -type NoteProperty).count
>
> # ...or
>
> (import-csv data.csv | get-member -type NoteProperty).count
>
> # row count
> # enclose the object in
> # array notation '@()'
> # ensuring the count of scalar objects
>
> @($csv).count
>
> # ...or
>
> @(import-csv data.csv).count
>
>
> --
> Kiron
>
My System SpecsSystem Spec