So I need to eliminate duplicates in my file, here is the content of one of my files
Inventory Date,Product Name,Version,Install Date,Status,Host Name
10/8/2010,Crystal Reports for Visual Studio,12.51.0.240,20100428,Installed,DAVID-PC
10/8/2010,Microsoft Office Access MUI (English) 2007,12.0.6425.1000,20100429,Installed,DAVID-PC
10/8/2010,Update for Microsoft Office Access 2007 Help (KB963663),,,Installed,DAVID-PC
10/8/2010,Security Update for Microsoft Office Access 2007 (KB979440),,,Installed,DAVID-PC
10/8/2010,Microsoft Office Access Setup Metadata MUI (English) 2007,12.0.6425.1000,20100423,Installed,DAVID-PC
10/8/2010,Adobe Acrobat 9 Pro Extended 64-bit Add-On,9.0.0,20100521,Installed,DAVID-PC
10/8/2010,"Adobe Acrobat 9 Pro Extended - English, Français, Deutsch",9.0.0,20100521,Installed,DAVID-PC
10/8/2010,"Adobe Acrobat 9 Pro Extended - English, Français, Deutsch",9.0.0,5/21/2010,Installed,DAVID-PC
10/8/2010,Fireworks Pack v1.0 for Pocket Tanks Deluxe,1,,Installed,DAVID-PC
10/8/2010,Adobe Reader 9.3.2,9.3.2,20100425,Installed,DAVID-PC
10/8/2010,AnyReader,3,20101002,Installed,DAVID-PC
This is the content of one of my csv files. In this case there is a duplicate, which is Adobe Acrobat 9 Pro. The thing is that both lines are not exactly the same so I can't do an exact comparison.
What I had in mind is split the lines at the "," and then compare it depending on the Product name. I was able to do this, but then I don't know how to write the whole line again instead of the word I was comparing it to.
Here is what I have so far.
Is there any way to modify this script so that it outputs the whole line again instead of the word. If not, can anyone point me in the right direction
Inventory Date,Product Name,Version,Install Date,Status,Host Name
10/8/2010,Crystal Reports for Visual Studio,12.51.0.240,20100428,Installed,DAVID-PC
10/8/2010,Microsoft Office Access MUI (English) 2007,12.0.6425.1000,20100429,Installed,DAVID-PC
10/8/2010,Update for Microsoft Office Access 2007 Help (KB963663),,,Installed,DAVID-PC
10/8/2010,Security Update for Microsoft Office Access 2007 (KB979440),,,Installed,DAVID-PC
10/8/2010,Microsoft Office Access Setup Metadata MUI (English) 2007,12.0.6425.1000,20100423,Installed,DAVID-PC
10/8/2010,Adobe Acrobat 9 Pro Extended 64-bit Add-On,9.0.0,20100521,Installed,DAVID-PC
10/8/2010,"Adobe Acrobat 9 Pro Extended - English, Français, Deutsch",9.0.0,20100521,Installed,DAVID-PC
10/8/2010,"Adobe Acrobat 9 Pro Extended - English, Français, Deutsch",9.0.0,5/21/2010,Installed,DAVID-PC
10/8/2010,Fireworks Pack v1.0 for Pocket Tanks Deluxe,1,,Installed,DAVID-PC
10/8/2010,Adobe Reader 9.3.2,9.3.2,20100425,Installed,DAVID-PC
10/8/2010,AnyReader,3,20101002,Installed,DAVID-PC
This is the content of one of my csv files. In this case there is a duplicate, which is Adobe Acrobat 9 Pro. The thing is that both lines are not exactly the same so I can't do an exact comparison.
What I had in mind is split the lines at the "," and then compare it depending on the Product name. I was able to do this, but then I don't know how to write the whole line again instead of the word I was comparing it to.
Here is what I have so far.
Code:
Set objFSO = CreateObject("Scripting.FileSystemObject")
strFile="I:\0-STUFF\Scripts\Newer\WORKING\New\PCs\DAVID-PC Software Info.csv"
Set objFile = objFSO.OpenTextFile(strFile)
Set dicSort = CreateObject("Scripting.Dictionary")
Do While Not objFile.AtEndOfStream
On Error Resume Next
strData = objFile.ReadLine
tempstrData = strData
MyArray = Split(strData, ",", -1, 1)
strData = MyArray(1)
dicSort.Add strData, dicSort.Count
Loop
objFile.Close
Set objFile = objFSO.CreateTextFile(strFile)
For Each Item In dicSort
objFile.WriteLine Item
Next
objFile.Close
WScript.Echo "Done"
Is there any way to modify this script so that it outputs the whole line again instead of the word. If not, can anyone point me in the right direction