Richard
Sat Mar 01 09:12:48 CST 2008
"Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
news:O8ZU96ueIHA.2000@TK2MSFTNGP05.phx.gbl...
>
> "Ed Peters" <edpeters345@yahoo.co.uk> wrote in message
> news:0a446cd9-9210-43b0-b00e-3ff139549440@i12g2000prf.googlegroups.com...
>> Hi all,
>>
>> I have a csv file which I need to be able to select certain fields and
>> then amend them to each line.
>> EG
>> ed, peters, DG, TH,,AG,3554 (note 5th field is blank)
>>
>> and so I would like to copy the 2nd and 6th fields and amend to the
>> record so it would be=
>> ed,peters,DG,TH,,AG,3554,peters,AG
>>
>> Thanks,
>>
>> Ed
>
> You could use the "split" function to read the fields into an
> array. This would make it easy to manipulate the individual
> elements.
If the fields in the csv file have no embedded commas and the fields are not
enclosed in quotes, the Split function works well. Otherwise, csv files can
be very tricky to read in VBScript programs. I have an example program that
uses a function to parse csv files linked here:
http://www.rlmueller.net/ReadCSV.htm
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab -
http://www.rlmueller.net
--