# TXT or PDF data processing ?

**URL:** <https://community.wolfram.com/t/txt-or-pdf-data-processing/7923>\
**Category:** Questions\
**Tags:** data-science, import-and-export\
**Created:** [February 17, 2016, 9:47am UTC](https://community.wolfram.com/t/txt-or-pdf-data-processing/7923 "2016-02-17T09:47:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimmycg](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@jimmycg](https://community.wolfram.com/u/jimmycg)\
**Post date:** [February 17, 2016, 9:47am UTC](https://community.wolfram.com/t/txt-or-pdf-data-processing/7923/1 "2016-02-17T09:47:02Z")

</div>

Hi, I am a beginner in Wolfram Language. I am wondering if it is possible to manipulate data of my own? Or perhaps PDF or even Bible and create my own set of attribute to manipulate?

---

<div class="post-metadata">

**Author:** ![lvveen](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/lvveen/32/4003_2.png) [@lvveen](https://community.wolfram.com/u/lvveen)\
**Post date:** [February 17, 2016, 9:48am UTC](https://community.wolfram.com/t/txt-or-pdf-data-processing/7923/2 "2016-02-17T09:48:48Z")

</div>

Hi Jimmy, I think the wolfram language is very strong at manipulating data. So I would say a safe bet to spend some money on a home edition. For manipulating PDF’s I presume you mean Adobe PDF and some caution is needed. The PDF import had not much attention and for me only 50% of the PDF’s I would like to import don’t work. I mainly use other tools to convert it to TXT and then I’m fine (most of the time).

---

<div class="post-metadata">

**Author:** ![wolframcommunity](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/wolframcommunity/32/8335_2.png) [@wolframcommunity](https://community.wolfram.com/u/wolframcommunity)\
**Post date:** [February 17, 2016, 10:04am UTC](https://community.wolfram.com/t/txt-or-pdf-data-processing/7923/3 "2016-02-17T10:04:17Z")

</div>

Please keep in mind related discussion: [Tools and tutorials for a Data Mining beginner?](https://wolfram.discourse.group/t/7887/1)

---

<div class="post-metadata">

**Author:** ![mthiel](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mthiel/32/42877_2.png) [@mthiel](https://community.wolfram.com/u/mthiel)\
**Post date:** [February 17, 2016, 8:37pm UTC](https://community.wolfram.com/t/txt-or-pdf-data-processing/7923/4 "2016-02-17T20:37:32Z")

</div>

Dear All,

here is a little analysis of the main words in the bible (because that was an example mentioned in the original post):

```
bibleTxt = Import["http://www.gutenberg.org/cache/epub/10/pg10.txt"];
WordCloud[DeleteStopwords[TextWords[bibleTxt]]]

```

 ![ScreenShot2016-02-17at20.25.19.png](https://global.discourse-cdn.com/wolfram/original/3X/9/f/9f710e094276d438ee162e64f28eea4ad937bf10.png)

Regarding the comment above about the problems with pdf files: I am working on a project where I need to analyse millions of pdf files scanned all over the world. There are in fact many of those which Mathematica cannot open. I found that converting them on a command line to ps and then back to pdf works usually very well. I usually work on Linux based machines, where this is no problem. But this also works on Windows if you use for example [cygwin](https://www.cygwin.com). Using that procedure the pdf problems virtually vanish.

Once the pdfs are fixed there is no problem. For example on [this page](http://www.mat.univie.ac.at/~gerald/ftp/book-ode/) the author makes -with permission of the AMS - a pdf file of a good book on ODEs available for personal use. Exactly the same code as above works for the analysis of this pdf file:

```
odestxt = Import["http://www.mat.univie.ac.at/~gerald/ftp/book-ode/ode.pdf", "Plaintext"];
WordCloud[DeleteStopwords[TextWords[odestxt]]]

```

 ![ScreenShot2016-02-17at20.36.22.png](https://global.discourse-cdn.com/wolfram/original/2X/9/9cfe6258b13e0670a32d78c23d731e27d78d8464.png)

Of course you might want to do some additional preprocessing of the textiles, but I think that this shows how extremely well Mathematica copes with different file formats.

Cheers,

Marco

PS: I strongly recommend downloading the pdf of the ODE book for personal use. As I said it is a good book.  
PPS: Note that the full command to download the bible analyse the text and make the word cloud easily fits into a tweet:

```
WordCloud[DeleteStopwords[TextWords[Import["http://www.gutenberg.org/cache/epub/10/pg10.txt"]]],IgnoreCase->True]

```

has 112 characters or so you could [tweet it to Wolfram’s tweet-a-program section](https://www.wolfram.com/language/tweet-a-program/).

---

<div class="post-metadata">

**Author:** ![henrikschachner](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikschachner/32/32119_2.png) [@henrikschachner](https://community.wolfram.com/u/henrikschachner)\
**Post date:** [February 18, 2016, 8:50am UTC](https://community.wolfram.com/t/txt-or-pdf-data-processing/7923/5 "2016-02-18T08:50:32Z")

</div>

Dear Marco, I was having a similar problem - and now you solved it! Thank you very much for your great posts!

Best regards – Henrik
