Solved

How can I import a text file into excel then format the data easily?

Posted on 2011-02-16
14
258 Views
Last Modified: 2012-08-13
Hello all!

I orginally had a horrible pdf file with a bunch of tables and information on it.  As seen in the standard pdf picture

I then used PDFZilla to convert the pdf to a text file. The output can be seen in sampletext.


Then this is where my problem is...


when ever i try to import the text file into excel, I have lots of trouble to get it to format correctly. I try text to columns but i cant get it to separate the numbers correctly.


I don't care about the column headers, but I do need the row data to be separate so that I can write a macro to extract the data and then copy it to another workboook.


Please help! I hope that I have provided enough explanation.
Standard-Pdf.png
SampleText.txt
0
Comment
Question by:jtovar3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +3
14 Comments
 
LVL 3

Expert Comment

by:Richard2k4
ID: 34909523
if it was me, I would write a script in Powershell or VB to parse the text and seperate the words from the numbers section...then i would import only the numbers as space delimited.   Insert a blank column and then paste in the word sections
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 34909528
Have you looked at the text file that gets created?  There are no separators.
I've seen that a lot when copying pdf files and consider it a problem with the automation mechanism used to examine the document.
Anyway, it seems that your PDFZilla tool is not working on that pdf document.
0
 
LVL 10

Accepted Solution

by:
shahzadbux earned 500 total points
ID: 34909761
Agree with rspahitz - no separators means looking at the txt file you cant tell where one number begins and the next starts.

Have you tried to select all in the pdf then copy\paste into excel - anything half useful? could then work with it and pull out the info in an acceptable format..
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jtovar3
ID: 34910552
actually the copy and paste actually didnt work out too bad... surprisingly.

do you have any tips on writing a script to automatically open a pdf, copy all, then paste into excel?

I also need to work on a code to find specific sets of data then transfer them to a separate spreadsheet, but i think i should separate that into a different question thread
0
 
LVL 10

Expert Comment

by:shahzadbux
ID: 34910587
Hmm...only way I know off the top of my head is to use AutoIT, maybe a vb script?

Anyone else have another suggestion?
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 34911256
I tried it by adding a pdf reference to VBA and opened the pdf and it was excessively complicated to interpret because of the way pdfs are created.  Much easier to copy/paste by hand.
0
 
LVL 26

Expert Comment

by:redmondb
ID: 34912502
rspahitz,

Do you have an OCR program?

For example, I have used ABBYY FineReader a lot for converting PDF's and TIFF's to text. This particular OCR (can't speak for others, obviously) recognises when the text is available uses that, bypassing any actual character recognition.

Regards,
Brian.

0
 
LVL 22

Expert Comment

by:rspahitz
ID: 34913627
B, I don't think that comment was meant for me.  I haven't had an OCR program in about 10 years and really don't use one, but it sounds useful for pdf interpretations.
0
 
LVL 26

Expert Comment

by:redmondb
ID: 34915011
Apologies, rspahitz!
0
 
LVL 7

Expert Comment

by:andymacf
ID: 34920998
We have the full version of Adobe Acrobat Pro, this allows you to convert the pdf, and then you can copy and paste directly from it to excel/word. Quite a worthwhile tool.
0
 
LVL 26

Expert Comment

by:redmondb
ID: 34921060
andymacf,

Thanks.

Presumably you had tried that before using PDFZilla?

Regards,
Brian.
0
 
LVL 7

Expert Comment

by:andymacf
ID: 34921325
Brian
I have looked at PDFZilla and I don't think it will work in this scenario.  What jtovar3 needs is something that will convert the pdf to a csv file. I found this, it might work.

1.      Open the desired PDF document in Acrobat Standard or Professional.
2.      Select "Export" under "File" and choose "Text." Some versions of Acrobat include options for "Text (accessible)" and "Text (plain);" choose "Text (accessible)" to preserve basic formatting.
3.      Type the file name for the converted document and click the "Save" button. Acrobat saves text files as tab-delimited files.
4.    Launch the spreadsheet application (such as Microsoft Excel or OpenOffice Calc) and select "Open" under "File" in the top menu bar.
5.      Select the text file created in Step 3 and click the "Open" button to launch an Import Wizard.
6.      Review the pages in the Import Wizard to select how the data is organized in columns and click the "Next" button to navigate through the wizard. For example, select "Delimited" to specify fields and click the option next to "Space" or "Comma" to specify how the fields are separated.
7.      Click the "Finish" button.
8.      Select the "Save As" function (usually under "File" in the top menu bar) and select the file type as "CSV (Comma-Separated Values)." Select "CSV (Windows)" instead of "CSV (MS-DOS)" if this option is displayed.
9.      Click the "Save" button.

http://www.ehow.com/how_5816209_convert-pdf-csv.html
0
 
LVL 26

Expert Comment

by:redmondb
ID: 34921586
andymacf,

Please read my last post again - I was querying why he was using PDFZilla when he has Adobe Acrobat Pro!

Cheers,
Brian.
0
 

Author Closing Comment

by:jtovar3
ID: 34998986
I'll post another question about scripts to open adobe and copy and paste.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question