+ Reply to Thread
Results 1 to 12 of 12

read pdf or doc file line by line and then parse the data into the proper cells and rows.

  1. #1
    Registered User
    Join Date
    02-21-2013
    Location
    Wichita, KS
    MS-Off Ver
    Excel 2003
    Posts
    6

    read pdf or doc file line by line and then parse the data into the proper cells and rows.

    I have the data to import / read in a pdf, in a doc, or in an Excel worksheet whichever is easier to use.
    I need to import the data, parse it into the correct cells for that row and then repeat the import until the end of the file.
    Not all the cells are in each group of data to import, so those cells will be null for that row.
    Some of the data for one cell may be in up to 14 lines in the data file. I have be concatenating these data rows into one cell.
    There are 48,000 lines in the file to import or I would do this manually.
    I am assuming that doing this in VBA would be the most efficient method.
    Thanks,
    rtphilli
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-13-2013
    Location
    Oklahoma
    MS-Off Ver
    Office 2007 / Office 2010
    Posts
    123

    Re: read pdf or doc file line by line and then parse the data into the proper cells and ro

    A couple of quick questions. Column A in the spreadsheet for the imported data appears empty, is this for a reason or can it be used? Column C does not appear to have a header, where does this data come from on the word document? Also, I notice some of the lines in the word document do not have a space between the word and the equals sign (CAS/Cockpit=), is this always the case or does it vary? Are the term definitions limited to a maximum of 10 or should it be dynamic to support more than that number? You've got two fields at the end, MCID and LMT, that have no values I can detect. Where do these fields get their vaules from in the raw data when they do appear? I'll need some sample lines to code these in. The last question, would you want a new sheet or workbook created for each import or just keep adding them to the existing sheet where the raw data is imported?

    I probably won't get to work on it until much later today, but it is doable.
    Last edited by Yraen; 02-24-2013 at 11:20 AM. Reason: more questions

  3. #3
    Forum Contributor
    Join Date
    01-13-2013
    Location
    Oklahoma
    MS-Off Ver
    Office 2007 / Office 2010
    Posts
    123

    Re: read pdf or doc file line by line and then parse the data into the proper cells and ro

    Okay, I've got it reading the doc file into memory I just need to know the answer to those questions. I figured out where column c comes from so I know what to do there. The lines like "CPN 963-5348-270 Rev - CAGEC 0EFD0 Rockwell Collins. - Proprietary Information Page: 12", do you want that data captured and stored?

    The best way to work with logs is in the original raw data format. Do you receive these in word format? Pdf? Txt? Something else?

  4. #4
    Registered User
    Join Date
    02-21-2013
    Location
    Wichita, KS
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: read pdf or doc file line by line and then parse the data into the proper cells and ro

    Column A can be used. I was using it while I was moving information manually, it is no longer needed for an import.
    The page information is also not needed. I have attached a portion of the file Excel Post 2 that contains the MCID information.
    Dynamic spacing is great because I would like to import other similar files with this.
    I would like the import to be in a new workbook if possible.
    Thanks for your time.
    rtphilli
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-21-2013
    Location
    Wichita, KS
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: read pdf or doc file line by line and then parse the data into the proper cells and ro

    Also, Column C that does not have a header can be titled Section if you need too.

  6. #6
    Forum Contributor
    Join Date
    01-13-2013
    Location
    Oklahoma
    MS-Off Ver
    Office 2007 / Office 2010
    Posts
    123

    Re: read pdf or doc file line by line and then parse the data into the proper cells and ro

    Here's the file. It's got a sheet1 that has a button to do what you wanted.
    Excel Post.xlsm

  7. #7
    Registered User
    Join Date
    02-21-2013
    Location
    Wichita, KS
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: read pdf or doc file line by line and then parse the data into the proper cells and ro

    Awesome, Thank you very much. I have a minor problem at this point.
    I get "Can't find project or library" when I run I click the button. I have the word doc in the same directory as the excel spreadsheet.

  8. #8
    Forum Contributor
    Join Date
    01-13-2013
    Location
    Oklahoma
    MS-Off Ver
    Office 2007 / Office 2010
    Posts
    123

    Re: read pdf or doc file line by line and then parse the data into the proper cells and ro

    If you go into the VBA editor and hit Tools > References, which one does it say is missing? I had to add Microsoft Word 14.0 Object Library, so that might be the one missing. Try unchecking it and adding in the version you have installed.

  9. #9
    Registered User
    Join Date
    02-21-2013
    Location
    Wichita, KS
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: read pdf or doc file line by line and then parse the data into the proper cells and ro

    Under Tools, References is grayed out and not selectable.

  10. #10
    Registered User
    Join Date
    02-21-2013
    Location
    Wichita, KS
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: read pdf or doc file line by line and then parse the data into the proper cells and ro

    I switched computers to use Excel 2010 and everything is working great.
    Excellent!!!!!
    Thank you very, very much.
    Last edited by rtphilli; 02-24-2013 at 09:44 PM.

  11. #11
    Forum Contributor
    Join Date
    01-13-2013
    Location
    Oklahoma
    MS-Off Ver
    Office 2007 / Office 2010
    Posts
    123

    Re: read pdf or doc file line by line and then parse the data into the proper cells and ro

    That's good to know. Let me know if there are any problems.

  12. #12
    Registered User
    Join Date
    05-03-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: read pdf or doc file line by line and then parse the data into the proper cells and ro

    Quote Originally Posted by rtphilli View Post
    Awesome, Thank you very much. I have a minor problem at this point.
    I get "Can't find project or library" when I run I click the button. I have the word doc in the same directory as the excel spreadsheet.

    Hi, rtphilli.
    I wonder you have used some
    PDF readers or Word Doc readers to help you with the related projects?
    Best Regards,
    Arron

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1