Newbie question-Condensing repeating rows with different corresponding data into single columns but keeping data seperate?

rsalmon

New Member
Joined
May 31, 2017
Messages
1
Apologies if this has been posted before. Tried googling and searching here without luck.

So for part of my job, I'm responsible for reviewing Facebook messenger data. Facebook provides the data in a PDF or HTML format, and is pretty messy and time consuming to review. What I'm trying to do is convert the data onto an excel sheet so I can better organize, search, filter, and cull through the thousands of messages. Here is the format it is typically provided in:

Author Joe Smith
Sent 2017-03-30 22:24:03 UTC
Body are u coming to the party?

Author Jane Smith
Sent 2017-03-30 22:27:03 UTC
Body Yepper!

Author Joe Smith
Sent 2017-03-30 22:29:03 UTC
Body Great, I'll bring the soda!!!!!!!!!!!!!

Author Jane Smith
Sent 2017-03-30 22:31:03 UTC
Body You better, I'm bringing the ice!
and otherwise I'll charge you!!


And on, and on, and onnnnnnnnnnnnnnnnnn (typical returns from FB can be over 10,000 pages). I can "save as" the PDF or HTML as a txt file. When I import it to Excel, I can get the repeating "header" (author, sent, body, etc) in repeating columns (a1, a2, a3, and so on) and the corresponding "data" in the next column (b1, b2, b3, etc.) The caveat is that if its a long message (as demonstrated by the last example above) the wraparound dumps half of the message in the correct corresponding cell (say b3 for this example) but the other half will drop down into a4?

What I'd like to be able to do is import the txt file into excel and convert to something like this:

Author Sent Body

Joe Smith 2017-03-30 22:24:03 UTC are u coming to the party?
Jane Smith 2017-03-30 22:27:03 UTC Yepper!
Joe Smith 2017-03-30 22:29:03 UTC Great, I'll bring the soda!!!!!!!!!!!!!
Jane Smith 2017-03-30 22:31:03 UTC You better, I'm bringing the ice! and otherwise I'll charge you!!

Where A1 would be Author, and B2 would be Sent, C3 Body, and then the corresponding data would be populated below in the columns below the headers.

Thanks in advance if anyone has anything for this!!!!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Should be possible with a macro. Are there blank lines in the .txt file separating the messages? Or do you just have to assume that a row starting Author is the beginning of the next message?
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,148
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top