Sign in to follow this  
Followers 0
JimC

tring to use several things to sort a section off a file

3 posts in this topic

I have tried to sort the [setupHotfixesToRun] section of the svcpack.inf file, but have had no luck. I have tried loading to a temp file and using _arraysort, but no luck. Any ideas ?

Thanks in advance for any suggestions.

[CatalogHeader]

[Version]

BuildNumber=2600

MinorVersion=1

MajorVersion=5

Signature="$WINDOWS NT$"

[setupData]

CatalogSubDir="\I386\svcpack"

[setupHotfixesToRun]

KB935840.exe /q /n /z /b:SP2GDR

KB935839.exe /q /n /z /b:SP2GDR

KB933566.exe /q /n /z /b:SP2GDR

KB932168.exe /q /n /z /b:SP2GDR

KB931784.exe /q /n /z /b:SP2GDR

KB931261.exe /q /n /z /b:SP2GDR

KB930178.exe /q /n /z /b:SP2GDR

KB929969.exe /q /n /z /b:SP2GDR

KB928843.exe /q /n /z /b:SP2GDR

KB928255.exe /q /n /z /b:SP2GDR

KB927802.exe /q /n /z /b:SP2GDR

KB927779.exe /q /n /z /b:SP2GDR

KB926436.exe /q /n /z /b:SP2GDR

KB926255.exe /q /n /z /b:SP2GDR

KB926247.exe /q /n /z /b:SP2GDR

KB925902.exe /q /n /z /b:SP2GDR

KB925486.exe /q /n /z /b:SP2GDR

KB925454.exe /q /n /z /b:SP2GDR

KB924667.exe /q /n /z /b:SP2QFE

KB924496.exe /q /n /z /b:SP2GDR

KB924270.exe /q /n /z /b:SP2GDR

KB924191.exe /q /n /z /b:SP2GDR

KB923980.exe /q /n /z /b:SP2GDR

KB923689.exe /q /n /z

KB923414.exe /q /n /z /b:SP2GDR

KB923191.exe /q /n /z /b:SP2QFE

KB922819.exe /q /n /z /b:SP2GDR

KB922760.exe /q /n /z /b:SP2GDR

KB920685.exe /q /n /z /b:SP2GDR

KB920683.exe /q /n /z /b:SP2GDR

KB920670.exe /q /n /z /b:SP2GDR

KB920214.exe /q /n /z /b:SP2GDR

KB920213.exe /q /n /z /b:SP2GDR

KB919007.exe /q /n /z /b:SP2GDR

KB918439.exe /q /n /z /b:SP2GDR

KB917953.exe /q /n /z /b:SP2GDR

KB917537.exe /q /n /z /b:SP2GDR

KB917422.exe /q /n /z /b:SP2GDR

KB917344.exe /q /n /z /b:SP2GDR

KB914389.exe /q /n /z /b:SP2GDR

KB914388.exe /q /n /z /b:SP2GDR

KB913580.exe /q /n /z /b:SP2GDR

KB912919.exe /q /n /z /b:SP2GDR

KB911927.exe /q /n /z /b:SP2GDR

KB911280.exe /q /n /z /b:SP2GDR

KB908531.exe /q /n /z /b:SP2GDR

KB908519.exe /q /n /z /b:SP2GDR

KB905749.exe /q /n /z

KB905414.exe /q /n /z

KB904706.exe /q /n /z /b:SP2GDR

KB902400.exe /q /n /z

KB901214.exe /q /n /z

KB901017.exe /q /n /z

KB900725.exe /q /n /z

KB899591.exe /q /n /z

KB899589.exe /q /n /z

KB899587.exe /q /n /z

KB896688.exe /q /n /z

KB896428.exe /q /n /z

KB896423.exe /q /n /z

KB896422.exe /q /n /z

KB896358.exe /q /n /z

KB893756.exe /q /n /z

KB893066.exe /q /n /z

KB891781.exe /q /n /z

KB890859.exe /q /n /z

KB890175.exe /q /n /z

KB890046.exe /q /n /z

KB888302.exe /q /n /z

KB887472.exe /q /n /z

KB885836.exe /q /n /z

KB885250.exe /q /n /z

KB883667.exe /q /n /z

KB873339.exe /q /n /z

KB911564.exe /q /n /z

KB893803v2.exe /q /n /z

[ProductCatalogsToInstall]

KB935840.cat

KB935839.cat

KB933566.cat

KB932168.cat

KB931784.cat

KB931261.cat

KB930178.cat

KB929969.cat

KB928843.cat

KB928255.cat

KB927802.cat

KB927779.cat

KB926436.cat

KB926255.cat

KB926247.cat

KB925902.cat

KB925486.cat

KB925454.cat

KB924667.cat

KB924496.cat

KB924270.cat

KB924191.cat

KB923980.cat

KB923689.cat

KB923414.cat

KB923191.cat

KB922819.cat

KB922760.cat

KB920685.cat

KB920683.cat

KB920670.cat

KB920214.cat

KB920213.cat

KB919007.cat

KB918439.cat

KB917953.cat

KB917537.cat

KB917422.cat

KB917344.cat

KB914389.cat

KB914388.cat

KB913580.cat

KB912919.cat

KB911927.cat

KB911280.cat

KB908531.cat

KB908519.cat

KB905749.cat

KB905414.cat

KB904706.cat

KB902400.cat

KB901214.cat

KB901017.cat

KB900725.cat

KB899591.cat

KB899589.cat

KB899587.cat

KB896688.cat

KB896428.cat

KB896423.cat

KB896422.cat

KB896358.cat

KB893756.cat

KB893066.cat

KB891781.cat

KB890859.cat

KB890175.cat

KB890046.cat

KB888302.cat

KB887472.cat

KB885836.cat

KB885250.cat

KB883667.cat

KB873339.cat

KB911564.cat

KB893803v2_wxp.cat

Share this post


Link to post
Share on other sites



If read to an array, _arraysort should work just fine. It didn't work for you?

Did you read it all to the array ok?

maybe remove everything after "*.exe" or "*.cat" then _arraysort

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Just put the content you want sorted into a text file and this script should do the trick:

#include <File.au3>
#include <Array.au3>
Dim $arr
_FileReadToArray("C:\test.txt", $arr)
Dim $newarr[UBound($arr)]
For $i = 1 to UBound($arr) - 1
    $newarr[$i] = StringMid($arr[$i], 3)
Next
_ArraySort($newarr)
For $i = 1 to UBound($newarr) - 1
    $newarr[$i] = "KB"&$newarr[$i]
Next
_ArrayDisplay ($newarr)

maybe remove everything after "*.exe" or "*.cat" then _arraysort

removing the leading KB did the trick :) Edited by enaiman

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0