View Single Post
Old 12-27-2007   #4 (permalink)
Keith Hill [MVP]


 
 

Re: Adding data to a hash table

"NeilOz" <NeilOz@xxxxxx> wrote in message
news:64A62FA8-4C54-49AC-9EEC-993ABB38D334@xxxxxx
Quote:

> I have imported a csv using import-csv
>
> $clcode = import-csv $csvlocation | select clcode
>
> $clcode results are a list of 6 digit numbers, for the next part of the
> script I need to add ',' to the end of the 6 digits, I have messed around
> with different methods and have been unable to figure out how to do it,
> easily.
Try this:

$clcode = import-csv $csvlocation | select clcode | foreach
{"$($_.clcode),"}

This just uses string interpolation to convert the number into a string
followed by the comma.

--
Keith

My System SpecsSystem Spec