News, tips, advice, support for Windows, Office, PCs & more. Tech help. No bull. We're community supported by donations from our Plus Members, and proud of it
Home icon Home icon Home icon Email icon RSS icon
  • Copy last line of PDF file into spreadsheet

    Posted on WSJohn_2014 Comment on the AskWoody Lounge

    Home Forums AskWoody support Productivity software by function MS Excel and spreadsheet help Copy last line of PDF file into spreadsheet

    Viewing 3 reply threads
    • Author
      Posts
      • #1983406 Reply
        WSJohn_2014
        AskWoody Lounger

        Hi,

        I have multiple of PDF files and i want to copy the last line of second last page into spreadsheet cells, PDF last line starting title Total Count Amount (jpeg image attached). Each pdf file contains 30 to 35 page summary and copying the final line from individual file is very difficult, Is it possible with macro.

        Thanks in advance.

        Append

        • This topic was modified 11 months, 2 weeks ago by WSJohn_2014.
        • This topic was modified 11 months, 2 weeks ago by WSJohn_2014.
        Attachments:
      • #1983505 Reply
        mn–
        AskWoody Lounger

        This is likely “possible” but may or may not be “feasible”.

        Not sure about doing it as an Excel macro, I’m not an expert on those.

        But, well. It is in general possible to convert the “text” elements of a PDF to plain text and then extract the last line of that… but depending on how the PDF was generated, the text may not be stored and therefore extracted in the same order as it was displayed in.

        Tables and multiple-column output in general can sometimes be a bother that way.

        And that’s not counting the PDFs that have images of text where you can at most extract an image file and run OCR on that, or white-on-white or other invisible text mixed in …

        So, it might be quite simple or very difficult, depending on how the PDFs are generated.

      • #1983725 Reply
        Paul T
        AskWoody MVP

        I’ve not seen a way to screen scrape with VBA, but you can do it with AutoIt / AutoHotKey – you have to program it yourself.

        If the task is difficult manually it probably won’t be easy to write either, but if you have a lot to do it may be worthwhile.

        Are you able to consistently obtain the required information? i.e. load file, move to the required location, collect the information at the same place.

        Are you able to post a sample without sensitive data?

        cheers, Paul

      • #1984096 Reply
        zeddy
        AskWoody_MVP

        Hi

        It is easy to process a set of pdf files with Excel VBA.

        But it would help a lot if we had some sample test pdf files that had some representative dummy data. Two or three sample files would be OK.

        It would also help to know what spreadsheet version you were using, and whether you had Adobe Acrobat available, of just the free Adobe Reader.

        zeddy

        Excel Tactical Nuclear Penguin Team

    Viewing 3 reply threads

    Please follow the -Lounge Rules- no personal attacks, no swearing, and politics/religion are relegated to the Rants forum.

    Reply To: Copy last line of PDF file into spreadsheet

    You can use BBCodes to format your content.
    Your account can't use Advanced BBCodes, they will be stripped before saving.