Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

extract data from multiple lines into 1 line

Status
Not open for further replies.

Snug

MIS
Sep 5, 2001
59
US
I have a report that I get in a flat text file that looks like the example 1 below. Is there a macro or VB code that I can write to extract data from certain fields so that the data looks like Output 1 below? Each record line has a blank line between them. There are 3 lines for each record. The lines are separated by a manual line break, it’s not a text wrap.

Any advice or point in the right direction would be appreciated! The final output will be going into an Excel spread sheet. I dont mind in I have to import it into excel.

Example 1: There are 3 lines for each record and a blank line after each record. Sorry, it doesn't show that here in this window.
12/01/05 120105 last, first 1254545121 12121212212 5 e mccu 4 doe md rd mccu
12 106 private ama 12/24/01 11/01/66
Pain m

12/01/05 120105 last, first 1254545121 12121212212 5 e mccu 4 doe md rd mccu
12 106 private ama 12/24/01 11/01/66
Pain m

Output 1:
4 doe,md mccu 12 106 ama 11/01/66
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top