On 9 août, 12:38, Shay Levi <n...@addre.ss> wrote:
> Try this:
>
> $csv = import-csv .\test.csv
> $csv
> $csv | add-Member -memberType noteProperty -name Field6 -value "" -force;
> $csv | gm
> # you should see a new note property names field6
>
> $csv | % {$_.Field6 = $_.Field1+$_.Field2}
> $csv
>
> Shayhttp://scriptolog.blogspot.com
>
>
>
> > Hello,
>
> > I start with PS, and ... hum, difficult for me 
>
> > I have a CSV file, like this :
>
> > Field1;Field2;Field3;Field4
> > John;PATTY;555-12345;NY
> > Homer;MAC CULLY;555-32147;NH
> > Selma;BOUVIER;555-12378:KS
> > And i want to parse and modify it, this is the target :
>
> > Field0;Field1;Field2;Field3;Field4;Field5
> > John PATTY;John;PATTY;555-12345;NY;JP
> > Homer MAC CULLY;Homer;MAC CULLY;555-32147;NH;HM
> > Selma BOUVIER;Selma;BOUVIER;555-12378;KS;SB
> > So, add two fields which are given by other fields in the CSV
>
> > Field0 = Field1 + Field2
>
> > Field5 = Initials of Field0
>
> > Shall i use import csv ? Or can i use a foreach command piped with a
> > type MyFile.csv ?
>
> > Thanks for you help.
>
> > --
> > P.A.- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -
Thanks Shay !
--
P.A.