I've been converting some 40 different html pages to a responsive format, and one of the things I had to make was a couple of new style sheets, one being for mobile screens. After awhile, all the various id and classes get hard to recall, so I made this little utility to parse out all the id and class tags, used in each html page.
The utility is for Windows systems...
1) Makes a list of all the html pages in the directory: c:\mywebpages
2) parses and collects the id and class styles out of the html and places them into an array.
3) Sorts duplicates out of the array.
4) Writes the results to a file called: css-class.txt.
5) Opens css-class.txt in Notepad.
Anyway, it's easy to change the names of the files, directory, etc.; so, if anyone needs such a utility, well, here it is...
'WIDTH 80, 43
dir$ = "c:\mywebpages\"
'SHELL _DONTWAIT "notepad tmp.tmp"
LINE INPUT "Overwrite file css-class.txt? (y/n) ", ans$
x$ = z$
cnt
= 0: ncnt
= 0:
REDIM s$
(1000), style$
(1000) 'PRINT style$
cnt = cnt + 1: s$(cnt) = style$
x$ = z$
'PRINT style$
cnt = cnt + 1: s$(cnt) = style$
s$(j) = ""
IF s$
(i
) <> "" THEN ncnt
= ncnt
+ 1: style$
(ncnt
) = s$
(i
)
Feel free to modify it, expand on it, whatever.
Note that as coded, it lists id results first, followed by class.
Oh, and a big thanks to Amazing Steve for posting that neat load the whole file at once part, some months ago, with the GET statement. That sure beats concatenating with LINE INPUT or using GET with a pre-DIM string, like DIM a as STRING * 1000 and using GET #ff, , until a remainder is all that's left and then dealing with a LOF() math function for that.
Pete