LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-04-2014, 02:25 PM   #1
ibabhelix
Member
 
Registered: Sep 2009
Posts: 51

Rep: Reputation: 18
Code to convert pdf to csv


Hi,

I am working on a tool where I need to convert pdf file to csv.

I dont know much about converting file formats.
Please let me know if we already have an utility to convert pdf to csv filemat .

Thank you
 
Old 08-04-2014, 02:48 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,727

Rep: Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170
Quote:
Originally Posted by ibabhelix View Post
Hi,
I am working on a tool where I need to convert pdf file to csv.

I dont know much about converting file formats. Please let me know if we already have an utility to convert pdf to csv filemat .
There are many tools to convert PDF's into readable text..providing the PDF *IS* text to start with, and not just pages of scanned images. The pdftotext utility is one...there are several others; did you even try to look this up with a Google search????

Since you've been here for over five years now, and have asked questions about shell scripting and programming, it should be easy for you to do something with the pdftotext utility and standard Linux commands (split, grep, sed, etc.), to get a CSV file. Since you don't post any examples of the input, the desired output, or give us ANY details at all, there's not much else we can tell you.
 
1 members found this post helpful.
Old 08-06-2014, 02:11 PM   #3
ibabhelix
Member
 
Registered: Sep 2009
Posts: 51

Original Poster
Rep: Reputation: 18
Yes, I have been here for 5 years but not working on Linux anymore. Well anyways , I too found this utility pdftotext .
I am trying to get the utility .

Is there any other tool you know of ?

Thank you
 
1 members found this post helpful.
Old 08-06-2014, 02:44 PM   #4
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
there is no magic tool to convert your pdf to csv

BUT, as already pointed out by TBOne, there is a tool ( pdftotext ) which , when given a pdf containing text,, will output simple text.
you can then 'work with' that text output to create a 'csv' file
 
2 members found this post helpful.
Old 08-06-2014, 02:48 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,727

Rep: Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170Reputation: 8170
Quote:
Originally Posted by ibabhelix View Post
Yes, I have been here for 5 years but not working on Linux anymore. Well anyways , I too found this utility pdftotext. I am trying to get the utility.
It is probably already installed on your system, or available through the online repositories of your distro. As was said before, you don't tell us ANYTHING about your setup, give us data examples, or even tell us what version/distro of Linux. Unless you provide details and answer questions when asked, there's not much point in posting, since there's not much anyone can tell you.
Quote:
Is there any other tool you know of ?
There is no tool to do exactly what you want to do...because there are an almost INFINITE number of possibilities and variables about "creating a csv". Like what to split on? Character set? Quoted fields or not? Quotes WITHIN the fields??

As said, extract the text from the PDF to a file...work with it from there. How you do that will depend on the data, and what you write your script/program in.
 
Old 08-06-2014, 03:39 PM   #6
jkirchner
Senior Member
 
Registered: Apr 2007
Location: West Virginia
Distribution: Manjaro
Posts: 1,012

Rep: Reputation: 321Reputation: 321Reputation: 321Reputation: 321
Quote:
Originally Posted by ibabhelix View Post
Hi,

I am working on a tool where I need to convert pdf file to csv.

I dont know much about converting file formats.
Please let me know if we already have an utility to convert pdf to csv filemat .

Thank you
Does the pdf contain a data table? If it is a table sometimes you get lucky doing a copy from the pdf and pasting into a spreadhseet program A cheat but I have had it work.

If this pdf does not have a data table, why would you want it as a csv anyway? Seems to me a text file would be better.
 
1 members found this post helpful.
  


Reply

Tags
convert, csv, pdf


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me convert this xml file to csv xmrkite Linux - Software 2 06-21-2014 09:48 PM
Perl convert csv to xls hawk__0 Programming 3 09-16-2009 09:13 AM
[SOLVED] Convert CSV to Tab imkornhulio Programming 7 11-15-2008 07:20 PM
Convert into CSV file say_hi_ravi Programming 4 07-17-2008 03:25 AM
Convert pdf to html or txt or remaster the pdf? jago25_98 Linux - Software 1 12-13-2005 01:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration