smsstech
asked on
Sort contents of text file with headers alphabetically using vbs
Hi all,
I need to sort, using vb script, the contents of a text file that looks like this:
[WEBN]
Wam Es= 1
AIG Esk=1
Aviv RJF=1
[TABB]
Sch Ins=1
CMH Cap=1
AIG Esk=1
Stikem Ell=1
to have the information under the users name alphabetical like this:
[WEBN]
AIG Esk=1
Aviv RJF=1
Wam Es= 1
[TABB]
AIG Esk=1
CMH Cap=1
Sch Ins=1
Stikem Ell=1
As you can see, the only items to be sorted are those between the closing ] of a users name to the opening [ of another users name, etc. Please note that I do not need the users sorted at all, just the data below their section. In my example, [WEBN] can continue to come before [TABB].
I need this in vb script. Any help would be appreciated. Thanks.
I need to sort, using vb script, the contents of a text file that looks like this:
[WEBN]
Wam Es= 1
AIG Esk=1
Aviv RJF=1
[TABB]
Sch Ins=1
CMH Cap=1
AIG Esk=1
Stikem Ell=1
to have the information under the users name alphabetical like this:
[WEBN]
AIG Esk=1
Aviv RJF=1
Wam Es= 1
[TABB]
AIG Esk=1
CMH Cap=1
Sch Ins=1
Stikem Ell=1
As you can see, the only items to be sorted are those between the closing ] of a users name to the opening [ of another users name, etc. Please note that I do not need the users sorted at all, just the data below their section. In my example, [WEBN] can continue to come before [TABB].
I need this in vb script. Any help would be appreciated. Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER