Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Parsing with VBA in Excel  (Read 3976 times)

0 Members and 1 Guest are viewing this topic.

markoium

  • Guest
Parsing with VBA in Excel
« on: April 04, 2006, 03:15:47 PM »
Hello all, I received a .csv file containing the HTML code generated from running a web-based report. I need to parse the file to get rid of all the HTML, leaving only the viewable text. I would like to  just run a macro to perform this but if someone knows another way, say in VB.Net, that will be fine also. Unfortunately I cannot attach the file due to the sensative nature of the data. Thanks in advance for any help provided.
Mark Oium

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Parsing with VBA in Excel
« Reply #1 on: April 04, 2006, 04:06:43 PM »
I found this little VB program you may be able to use or modify.

Strip HTML

Once you get rid of the HTML tags with the resulting csv text, you can use the SPLIT function to build a zero-based, one dimensional array (use the comma as a delimiter) and go from there.

Hope this gives you some ideas.  8-)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: Parsing with VBA in Excel
« Reply #2 on: April 05, 2006, 01:14:41 AM »
How about the extremely easy method of loading the fileup into a browser?  (Rename to .html first.)  Copy and paste from the broswer to Notepad.  All HTML and formatting will be gone.
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos

soybean



    Genius
  • The first soybean ever to learn the computer.
  • Thanked: 469
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 10
Re: Parsing with VBA in Excel
« Reply #3 on: April 05, 2006, 07:57:06 AM »
I have the impression this is a one-time situation.   If so, why not just use the Text to Column command or the Text Import Wizard in this case?  Isn't all the data in a single column when you first import or copy it into Excel.  If so, then you just select the whole column and parse it.  For a one-time situation, there's not point in even recording a macro to do this.