BookmarkSubscribeRSS Feed
jerry898969
Pyrite | Level 9

I have a text file I have to import.  This file contains an id field and then html.

0000001^<tr><td>TEST1</td><td>01/01/01</td><td>FRANK</td></tr><tr><td>TEST2</td><td>01/02/01</td><td>DAVE</td></tr>

0000002^<tr><td>TEST1</td><td> </td><td>WILL</td></tr>

0000003^<tr><td>TEST1</td><td>02/11/12</td><td>JIM</td></tr><tr><td>TEST2</td><td>02/12/13</td><td>Greg</td></tr><tr><td>TEST3</td><td> </td><td> </td></tr>

I need to create a data file that will parse each row and create a multiple rows for every <tr></tr> combination.  Based on the above data the results should be

ID

0000001 TEST1 01/01/01 FRANK

0000001 TEST2 01/02/01 DAVE

0000002 TEST1               WILL

0000003 TEST1 02/11/12 JIM

0000003 TEST2 02/12/13 Greg

0000003 TEST3

Thank you for any help.

1 REPLY 1
Reeza
Super User

Try googling with the search terms : SAS IMPORT HTML TABLE

There are a few papers and references that look promising, as well as a suggestion to use XML processing.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 719 views
  • 0 likes
  • 2 in conversation