I import a CSV file containing a primary key and some data, for example
key,data
1,one
2,two
3,three
4,four
5,five
I want the data field of one record, based on the key value. here's what I do
$db=import-csv data.csv
$data=($db|?{$_.key -eq 4}).data
is there a smarter/more elegant way to write the second line ?
PS. for this time, I'm stuck with PS v2