| |
danielc
Posts: 10
Score: 0
Joined: 3/2/2007
Status: offline
|
Hello all, Below is the script i have written and a sample of the CSV file: Option Explicit Dim sFileName, dCodes, objFSO, ts, aLine Const ForReading = 1 sFileName = "c:\test3a.txt" Set dCodes = CreateObject("Scripting.Dictionary") Set objFSO = CreateObject("Scripting.FileSystemObject") Set ts = objFSO.OpenTextFile(sFileName, 1) Do Until ts.AtEndOfStream aLine = Split(ts.ReadLine, ",") dCodes.Add aLine(0), aLine(1) Loop ts.close objFSO.close Brent, Givens Arturo, Jimenez Lillie, Campbell Robin, Posmanter Alice, Fletcher Chu, Vang Debra, Logan Debra, Nordyke What is happening is that the script will operate correctly and then error out when it reads the second Debra. My assumption is that key can only contain one Debra and not a duplicate. Am I correct and how can I get around this? Thank you in advance for your assistance, Daniel
|
|