0

I currently have a text file that looks like this

enter image description here

I need to be able to create a VBScript file that will use FileSystemObject to change the rows into columns and output the data into an html table like below

enter image description here

I am having a difficult time finding a method for transposing. I am new to VBscripting, I assume that I can still use the CreateTextFile method for HTML?

Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("C:\Users\User.mdm\Desktop\PracticeTest\table.html", True)
MyFile.WriteLine(?)
MyFile.Close
4
  • Hint: read the text file, fill a 2D array, transpose it, write html file. Commented Nov 16, 2016 at 23:51
  • 1
    Hint #2: instead of a 2D array which is indexed as array2D( row, column) would be simpler to fill a 1D array of 1D arrays which would be indexed as array1x1( row)( column). In any case, split your task into pieces of code that do a certain (simpler) sub-tasks (as I advised previously; just a kind of modular programming). Commented Nov 17, 2016 at 0:37
  • 2
    Instead of asking, a bit searching would have showed you a nearly perfect template here in SO. VBscript - Transpose CSV File I didn't test but IMO all you have to change is path and tmp = Split(row, ",") to tmp = Split(row, "|") Commented Nov 17, 2016 at 0:57
  • Thanks guys for the help/direction. I just need to work on figuring out the html piece Commented Nov 17, 2016 at 2:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.