I am trying to learn VBS to solve a problem that happened when I tried to import a file on my system. The file has more than 4000 rows and all rows must be 240 characters long. (I do not have backup)
Currently, the document is unconfigured like this:
The first line is ok with 240.
The second line is only with CRLF. (0).
240 + 0 = 240
The third line is 238 characters + CRLF (238 characters).
The fourth line is 2 characters + CRLF (2 characters).
238 + 2 = 240
The fifth line is 236 characters + CRLF (236 characters).
The sixth line is 4 characters + CRLF (4).
236 + 4 = 240
The seventh line is 234 characters + CRLF (234 characters).
The eighth line is 6 characters + CRLF (6 characters).
234 + 6 = 240
I noticed that this pattern continues throughout the file, so I think I can fix this for VBS.
Could anyone help me create a script to solve this problem?
I think I should read each line, use Len () to check the amount of characters and give a DELETE where the CRLF would be if the line has fewer than 240 positions.
Or maybe do Split and concatenate line k with line k + 1, in a loop where k starts with 0 (line 1 of the file) and will receive K = K + 2 at each iteration.
I'll try first to make the Split option. If someone wants to collaborate with some kind of code or just say a smarter way to solve the case, thank you!