CSV file without headers
What if your CSV file doesn’t have headers? well Powershell makes that pretty easy too. Essentially you have to read in the text then split the text into the separate columns.
$users=@(); get-content test.csv | foreach-object {$users+=,($_.split(“,”));};
|
Once that command is done your $users variable will have each field in your CSV into a separate array element. Then you can do something like $users[0][0] to get the first item in the first row or $users[-1][-1] to get the last item in the last row.
Here is a related blog post on arrays
http://blogs.msdn.com/powershell/archive/2007/01/23/array-literals-in-powershell.aspx