Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder saeed's Avatar
    Join Date
    Oct 2002
    Location
    West Yorkshire
    Posts
    343
    Thanks
    32
    Thanked 0 Times in 0 Posts

    Extract Row Data from file and saving in MYSQL tables using PHP

    Hello everyone,

    I have a pdf file in which there are about 1700 pages each page contains about 7 records and each record contains the following data:

    company_name,
    address_line_1,
    address_line_2,
    telephone,
    fax,
    email,
    name,
    exporter,
    importer,
    manufacturer,
    services.

    now in some records exporter, importer, manufacturer, services data isn't available and some does have address_line_3 as well.

    Sequence of the data is exactly the same mentioned above.

    I have a little idea that using PHP file can viewed and displayed it as results over the screen. I want to save it in MYSQL Database.

    Company name name starts M/s. in the beginning
    similarly "Tel:" for telephone, "Fax:" for fax, and so on.

    I will be very grateful if someone can give me an idea how this can be done.

    Thank you very much.
    Attached Thumbnails Attached Thumbnails Extract Row Data from file and saving in MYSQL tables using PHP-pdf-file-records.jpg  
    Don't click on this!

    #!/usr/bin/saeed

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    You can only do this if you have your own server.
    It requires XPDF installed for your server.
    http://www.foolabs.com/xpdf/about.html

    Once installed, you can read text from a PDF file.

    If you are using a shared webhost for your website, it cannot be done ... as far as I know.

  • #3
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,316
    Thanks
    23
    Thanked 613 Times in 612 Posts
    http://www.convertpdftotext.net/ is free software to convert pdf files into text files. Once done, it should not be a problem to open file and read it in php one line at a time, categorize the line, and place it into the correct SQL column.


  •  

    Posting Permissions

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