{"id":744,"date":"2012-09-06T19:52:23","date_gmt":"2012-09-06T19:52:23","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=744"},"modified":"2012-09-06T19:52:23","modified_gmt":"2012-09-06T19:52:23","slug":"parsing-pdf","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/parsing-pdf\/","title":{"rendered":"Parsing the PDF"},"content":{"rendered":"<p>I had to pull some data from a source, to create a Google map today. But, the only format the address data was in was a three-column PDF.<\/p>\n<p>As I toiled over the best way to go about parsing this data, I remembered the good old days of RTF files, and how life was so simple back then!<\/p>\n<p>The RTF option is a prime candidate for getting PDF data into a usable format. I proceeded as follows:<\/p>\n<ol>\n<li>Copy all PDF data and paste it into Windows Wordpad<\/li>\n<li>Save the file as an RTF<\/li>\n<li>Create a script, in programing language of choice\n<ol>\n<li>Read the RTF into a variable<\/li>\n<li>Use the carriage return character to split all lines into an Array or list<\/li>\n<li>Iterate over the list, parsing RTF codes from each line, and using them to identify the pieces of information you need<\/li>\n<li>Output the data<\/li>\n<\/ol>\n<\/li>\n<li>In my case, I needed to geocode a bunch of addresses, so I copy\/pasted the entire contents of my output over to <a href=\"http:\/\/www.findlatitudeandlongitude.com\/batch-geocode\/\" target=\"_blank\">http:\/\/www.findlatitudeandlongitude.com\/batch-geocode\/<\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had to pull some data from a source, to create a Google map today. But, the only format the address data was in was&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[15],"tags":[201,202,130],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/744"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=744"}],"version-history":[{"count":1,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/744\/revisions"}],"predecessor-version":[{"id":745,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/744\/revisions\/745"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}