Help using Base SAS procedures

Data with multiple delimiters

Super Contributor
Posts: 405

Data with multiple delimiters

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


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


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.

Super User
Posts: 23,771

Re: Data with multiple delimiters

Posted in reply to jerry898969

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.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation