Advertisement

12.11.2006 at 03:16PM PST, ID: 22089850
[x]
Attachment Details

Load Text file to Array

Asked by matrixnz in Microsoft Excel Spreadsheet Software

Tags: array, file, text, load

Using SMS I've created a report on computers with Software in Add/Remove Programs at a particular site, similar to the following:

Netbios Name      Manufacturer      Model            OS      Version      Size      RAM      Display Name
SITE-D-ASSET01      Dell            OptiPlex GX270      XP      5.1.2600      39205      509      Adobe Acrobat 7.0.1 and Reader 7.0.1 Update
SITE-D-ASSET02      Compaq            Evo D510 CMT      XP      5.1.2600      19091      247      Windows XP Hotfix - KB891781
SITE-D-ASSET03      Compaq            Deskpro            XP      5.1.2600      19091      254      Windows XP Hotfix - KB892944
SITE-D-ASSET04      Compaq            Deskpro            XP      5.1.2600      19091      254      Windows XP Hotfix - KB893066

The aim is to identify computers with Non Standard Build apps i.e. software not included in the Original Computer Build.  This includes applications like Adobe Acrobat, Flash Player, Java, Windows XP Hotfixes etc..  I wish to remove these from the list.  After some searching I found the following Macro to remove the lines by building an array.

Sub a()
Dim i, C, myArr, j
myArr = Array("Adobe Reader 6.0", "Adobe Acrobat 7.0.1 and Reader 7.0.1 Update", "Security Update for Windows XP (KB890046)", "Security Update for Windows XP (KB893066)", "Security Update for Windows XP (KB893756)")
For i = Range("A65536").End(xlUp).Row To 1 Step -1
For j = LBound(myArr) To UBound(myArr)
Set C = Rows(i).Find(myArr(j), LookIn:=xlValues)
If Not C Is Nothing Then
Rows(i).Delete
Exit For
End If
Next j
Next i
End Sub


However I'd like to just use a text file for the array so that I could build a list for e.g.

Adobe Acrobat 4.0
Adobe Acrobat 5.0
Adobe Acrobat 7.0.1 and Reader 7.0.1 Update
Adobe Acrobat 7.0.2 and Reader 7.0.2 Update
Adobe Acrobat 7.0.3 and Reader 7.0.3 Update
Security Update for Windows Media Player 9 (KB917734)
Security Update for Windows XP (KB890046)
Security Update for Windows XP (KB893066)
Security Update for Windows XP (KB893756)

and save it to C:\Removal.txt and than I can just add remove lines from the text file.

Does anyone know how I could do that.

CheersStart Free Trial
[+][-]12.11.2006 at 03:49PM PST, ID: 18119268

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.11.2006 at 05:39PM PST, ID: 18119729

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.11.2006 at 05:48PM PST, ID: 18119777

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Excel Spreadsheet Software
Tags: array, file, text, load
Sign Up Now!
Solution Provided By: webtubbs
Participating Experts: 1
Solution Grade: A
 
 
[+][-]12.11.2006 at 05:55PM PST, ID: 18119801

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32