I wonder if you've used Slim girl, it's a software designed to compress HTML hypertext files and script files. It is said that its compression rate reached more than 15%, I tried, and some files (large) compression rate incredibly reached 50%. I took the compressed file and the original file contrast, hey, it seems to simply put the space, carriage return and line break to remove. It seems that the software is nothing, I use VB can do one. I don't believe you, gentlemen.
First run VB, create a new Standard EXE project, add a text control on the window, two CommandButton controls and a CommonDialog control (file Dialog Control), and then set the Multiline property of the Text1 control to True. The ScrollBars property is set to 3, the other attributes are available by default, and then open the Code window to add the following code:
Option Explicit
Private Sub Form_Load ()
Commondialog1.cancelerror = True
Commondialog1.filter = "Web |*.htm;*.html"
Command1.Caption = "Open"
Command2.Caption = "Save"
End Sub
Private Sub Command1_Click ()
On Error Resume Next
Dim Textline as String
Commondialog1.showopen
If Err <> 32755 Then
Text1 = ""
' Open File
Open commondialog1.filename for Input as #1
Do with not EOF (1)
Line Input #1, Textline
' Remove the left and right spaces and wrap them.
Text1 = Text1 & Trim (textline) & VbCrLf
' If the above sentence is replaced by:
' Text1 = Text1 & Trim (textline)
' That is, remove the space but not the line, so that the compression rate is greater, but its readability is much worse
Loop Close #1
End If
End Sub
Private Sub Command2_Click ()
On Error Resume Next
Commondialog1.showsave
If Err <> 32755 Then
' Save file
Open commondialog1.filename for Output as #1
Print #1, Text1
Close #1
End If
End Sub
Code finished, press F5 run try, open an HTM file (28K, with Dreamwe R), save as another file, take a look, haha, only 13K.