View Single Post
  #1   Report Post  
MG
 
Posts: n/a
Default Transpose rows to columns w/varying numbers of lines per record

I have a text-file address listing with a couple of thousand entries of
varying number of lines--some have 3 lines:

Name
Address
City, State Zip

and others have 4:

Name
Etc (like "c/o" or contact name--no particular pattern to this)
Address
City, State Zip

There are no blank lines between records. I don't have any control over the
format of the text file, as it's an extract from another program and I can't
change the way the data is extracted.

I can't use Excel's transpose feature to get a useful spreadsheet because
the records aren't consistent in the number of lines per record. Is there a
way to convert this data to a spreadsheet with 4 columns per record (with a
blank column for the 3-line records)?