Extracting Text From PDF Files
I need to extract the text from a PDF file for storage in the database.
Is there a way to do this in PHP?...
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Extracting Text From Pdf
I have to index the text of a pdf document. Does any of you know of a PHP script/extension or a binary that is able to extract the text ? The pdf extension mentioned in the php.net docs seem to indicate that it's for _creation_ of documents only, is that so? Same with all the PHP classes i have found.
Extracting Text Between Tags Is Tricky!
Problem: I want to get the whole text between the opening tag <%OPTIONAL%> and the closing tag <%/OPTIONAL%>. The right block is found by (and contains) the placeholder {#xmreisepop_reisepreistext_1_3#}. <%OPTIONAL%> and <%/OPTIONAL%> are not allowed to be inside these tags again. My first idea was: <%OPTIONAL%>(.*?){#xmreisepop_reisepreistext_1_3#}(.*?)<%/OPTIONAL%> But this does not work with the following peace of text, because it takes the first <%OPTIONAL%> before and the first <%/OPTIONAL%> after the placeholder. <%OPTIONAL%> ....bla bla bla.... <%/OPTIONAL%> .... <%OPTIONAL%> .... {#xmreisepop_reisepreistext_1_3#} .... <%/OPTIONAL%> Then I tried it with this version: <%OPTIONAL%>(.*)(?!(<%OPTIONAL%>|<%/OPTIONAL%>)){#xmreisepop_reisepreistext_1_3#}(.*?)<%/OPTIONAL%> No success!
Extracting Email Attachment (Text)
What's the best way to extract email attachments that's encoded in base64? I can run the base64 encoded stuff through base64_decod(), but I want to know if there is a function to handle attachments. Example: ------_=_NextPart_001_01C7C330.9D7B678C Content-Type: text/plain; name=report.csv Content-Transfer-Encoding: base64 Content-Description: report_=.csv Content-Disposition: inline; filename=report.csv
Trouble Extracting Email Address From Text File
I'm trying to put together a script that will read an email box set up for newsletter bounces and remove the bad addresses. There's an old script I've worked with that looks for --- Permanant fatal errro ---, but not all the bounced emails have that line included (3 out of about 700 do). I need to find the bad address, then delete that address out of the database. I've got the deleting out of database down, but am not sure how to find any email address & delete it.
Parsing Text Files
I have a little brain freeze going here. I can't remember how to do this. I'm trying to parse a text DB file and seperate all information in it so that I can insert them into MySQL as seperate values in seperate fields. for example, 1 | howdy | there That would be three peaces with three different fields in MySQL. I know I've done this before but can't for the life of me figure out how I did it. All I need is somebody to jog my memory and get that little brain of mine weorking again.
Upload Text Files
Its only once you've got loads of content that you start filtering what people see based on their prefferences. To get lots of content you need to get people to upload text files which end up on web pages extending your site.
Cookie Text Files
I just added some cookies to my page, and they work fine, but I just wanted to know what the lines mean when I view the file in Notepad. PHP Code:
How Get Differences Between Text Files:
I have two text (configuration files) and I'd like to get the difference between these files. I'd like something like "diff" in linux or differences in wiki. how can I do?
Uploading Text Files
I'm somewhat new to this whole MySQL/PHP thing and need a little help. My web hosting service uses phpMyAdmin and at the bottom of the screen iis an area where I can upload a text file to populate a table. I have a table named groups with two fields: groups_idauto-increment primary groups_name So how do I create my text file to populate this table? I'm going to use MS Notepad. If it's set to auto-increment, do I need to include the number? If so, does it start at 0 (zero)? Would the file look like: 0,students 1,faculty 2, staff or just students faculty staff (though I can't image that working).
Creating Text Files On The Fly
What I want to do is allow a logged in user to download a text file version of the list they are viewing on the screen. So if they are viewing the Paid list of users, there should be a button on that same page that says Download To Text File, and when clicked, the user is prompted to download a text file version of the list.
Text Files Hit Counter
I have a script that I am using for text file based hit counter. I have been noticing that my the original hit count, in my text file has been fluctuating from the original amount to a very low amount. What is causing this and is there a good way to fix it? Code:
Create Different Text Files
I need to create a different text file every time a user registers. Currently every time a user registers there details are sent to "users.txt". So all user details are in the same text file. I would idealy like each text file to be named after the username registered. Here is the code currently being used: $username = $_POST['username']; $password = $_POST['password']; $data = "$username, $password /n"; $fh = fopen("users.txt", "a"); fwrite=($fh,"$data"); fclose=($fh);
Creating Text Files..
I want to set my access rules to 0777 so that I can delete the text file via script if I need to. I already set the folder to 0777 when I created it.. now I just need the text files. How would I set the access to 0777 when I create the file? This is what I have right now... $text= "this is text."; $fileName = "examplefolder1/example.txt; $handle = fopen($fileName, 'w'); fwrite($handle, $text); fclose($handle); Is there some way to do it in that statement?
Text Files Into Array
I'm trying to read a text file that has a bunch of names in it into an array so that I can output that array to a comma separated format. My problem is this, I do not know how to make a file go into an array, I've tried the explode function, but all that does is spit out "Resource ID" the format of the file is "1. FirstName LastName" with line breaks so the next line is "2. NewFirstName NewLastName", and so on...
Indexing Text Files In A Folder
I'm newbie on Php. I cannot write codes but only modify. I need a code doing this: I'll put text files in a folder like file1.txt,file2.txt ... I want to search this files, list most recent 10 and if files call, script will put into the site design with <pre> tags.
PHP - MySQL - Text Files - Speed
I've got a question that I'm sure is answered somewhere but I haven't run across it yet. I've got a site with a lot of content that's being pulled from a database. Most of the content changes on a very regular basis.. I take it, push it into some templates, and render it to the screen.. pretty standard stuff.. But some of the pages have large blocks of static content. Just as an example, lets take about 50 lines of formatted static HTML. This content doesn't change very often at all. The site is already designed to push through a template, so putting the content into static HTML pages isn't an option. The question is, should I store that content in MySQL or in a text file? I figured that MySQL would be easier on the system. The fetches seem like they would be pretty easy for MySQL to handle, no complex queries. I figured that pulling from a text file would require apache/php to open the file, read the file and then close the file every time someone hit that page. Am I putting unwarrented stress on our database?
Questions On Merging Two Text Files....
I will have a form field that will allow one of two text files to be uploaded to the db. This text file will have sections that are defined something liek this;
Opening All Text Files In A Folder
Im very new to php and need a bit of help. basically what I have is a folder with a number of text files inside. What i need to do is open every text file in that folder and then process the information inside each text file. Im not really sure but I would assume I open the directory and place the name of each text file into an array and then loop through the array and process the contents of the text file. #open directory #foreach text file in the directory #store file name into an array #loop through array #process code
Php Template For Multiple Text Files
I have over 800 text files. I need one php template webpage that can pull in text of requested file on request in url. Example: http://www.gothinia.com/chronicle/epos.php3?title=Title_Of_Text_File_With_Story.txt would place text of Title_Of_Text_File_With_Story.txt inside template called epos.php3 what code will do this in a simple effiencient manner?
Changing Data In Text Files
Is there an easy way in which I can edit values in a text configuration file? I am creating a form based interface to administrate a few text based config files. I can get the values from the file by parsing it line by line, but I cannot find an efficient way to edit data based on changes submitted in the php form. Is there any way to get to a position in a file and then overwrite any information?
Opening Text Files And Storing Them In A DB
I have a directory full of text files I need to open and store in the DB..... My question is about the file system stuff... I wanna open all files in a directory one by one is there a way to do a while loop of the files?
Includes And Writing To Text Files
i have 6 scripts, each writing to a text file. in addition, i have an index file with links to all the text files that includes all of these scripts. the problem is that the index file will run one script off the include list and then stop. it's incredibly bizarre to me and i'm not sure why it's happening.
Reading Variables From Text Files
I am playing with several text files that have variables stored in two different ways. One text file stores the data like this: hair=brown eyes=green gender=male The other text file stores data like this: hair=brown&eyes=green&gender=male How can I read the variables from the text file and use them in my php program? I know how to write them to a text file, but have no clue as how to read them.
Using PHP Offline To Manipulate Text Files
I need to create an application that will do fairly simple text manipulation on 20,000 files in text format (html files). The files exist both on my Windows machine and on a FreeBSD server. I prefer to do the manipulation on my machine where it's easier to create backup copies, recover from programming errors and so on, then upload the files to the server. All I'm doing is extracting certain elements from each file and creating a different file with the same content that will look better. I could do this in FrontPage (or even Notepad) if I didn't have 20,000 files, so I need to write an application that go through each file in a directory, open it, locate the relevant text elements and create a new file that has these text elements in an appropriate format. I'm comfortable that I can write an application like this in PHP, even though I do not have PHP installed on my computer, which is a Windows box and is not being used as a server. Does this make sense? Can I install and use PHP for this purpose without lots of server-related baggage?
Storing Classes In Text Files
is there a way to store class in a text file? and then recall thjem? and is there a better way to store variables and such than a text file, so its unreadable? what i mean abou my question is.. is it possible to make two classes: User1 and User2, and then recall them so you can get User1.password and User2.password, User1.ID, User2.ID, etc.
Align Text And Searching Files
i would like to align my following code so that it sets it to the left side of the ;page. ive tried a few things but didnt work. also i would like to have it so that it only searches for picture and movie files. how would this be accomplished? Code:
Comma Separated Text Files
A client has requested that I make a php app which takes an uploaded image, reads the values and enters them into a database. I've made the upload script which works fine, and the script which enters the values into the database, the only thing left now is how do I make PHP read the file and extract the values? The file is a text file, each field comma separated.
Grabbing Text From Files/strings/etc
Wondering how to grab pieces of text from a file. Let's say I opened a webpage and want to have all the values of the input fields. This would be the contents of the file <html> <head> ... </head> <body> ... <input type='hidden' name='hidden_w' value='123456' /> ... </body> </html> Now I want that value of the input field 'hidden_w' to be in the variable $w. How do I this?
Open, Search, And Process Other (text) Files
How could I use php to open, read, and perform operations on a file? Say I wanted to open somefile.htm and search for instances of <p class="one">Foo</p>, strip the tags, then put 'Foo' in a variable called $foo... Is this doable?
Full Text Search In PDF And Word Files ?
I need to perform full text searches on a batch of PDF and Word files. What is the best way to go? After some research, I'm thinking of extracting the plain text from the files with "pdftotext" and "catdoc", hamonizing the various possible encodings to UTF-8, storing the text in a MySQL database, and then using the full text search capabilities of MySQL. Do you think that would work well? I am told that the files are mostly text and won't be longer than 30 pages.
Problems W/PHPmyAdmin Inserting Text Files
I have been having some trouble with inserting text files into my MySQL database using PHPmyAdmin. I have used it before with success on other databases. Are there certain versions of MySQL that do don't support this. Whenever I try and submit the file it simply reloads the 'Insert Text File' form??
Editing And Deleting Flat Text Files
I am working on a php news script that uses text files for it's DB. I have most of it done except for the ability to edit or delete the articles in the DB. I have only been coding for about a week now so my skills are pretty limited and I have not found any tutorials that cover this issue so if anyone could be kind enough as to show me how this is done I would be most greatful....
Editing Text Files In Form Textareas?
I want to pull text files into a form text area and then edit them. to open the file I am using: $toEdit = fopen ("../content/concept.txt", "r+"); which does not work at all unless I change the path to c:xxxxxxxxxx but I dont want to do that. If I use the hard coded path I get permission denied, if I change the file to read only it seems ok - however, I want to load it into a form textarea? Cant work this out, then I want to save it. Its just to update a simple text schedule. there will be no special characters that need escaping etc. This is probably a pretty basic question but I have been asked to do this ASAP and my attempts so far have just confused me!
How To Change A Script Using Text Files To One Using MySQL?
I'm making a website for guitar effects and tabs, and I'm putting a system to let people rate an effect out of 5. I found this script in an online PHP library site, but I'd like to change it from using text files to using my database. I can either just add a field to each tab, "rating", or, if needs be, create an entire new table, "ratings", and link individual ratings to the tab in question with a tab_id field. Code:
Scalability Of Perl Cgi Programs That Load Text Files
Suppose you have a perl program that is called by a web page to generate another web page. The program is written to load data from a text file on the server and make certain substitutions in the loaded text prior to the output of html. If one user is on the site, it should not be a problem. If many users try to access it nearly simultaneously, will it be a problem? example:
Dynamically Genetrate RAM (Real Media) Text Files
I am working on a record company's site. They offer a selection of track snippets for stream/download. I would like to be able to dynamically generate the RAM (text File) to save manual input in the DB. Currently each RAM file has to be uploaded everytime a new track is added....but I'd like to have this created on the fly when a user is browsing the site. user selects track...is forwarded to the dynamically generated RAM file...which in turn selects the appropriate media. I can't think how i'd get this to work as I am trying to create a text file that is parsed rather than a peice of HTML that is read by a user. Perhaps on the server I'd have to add PHP Parsing to the RAM mime type?
Extracting Tar.gz
is it possible to extract tar.gz files on a remote server through PHP? Or do i need to use telnet or something?
Extracting Data From XML ?
The following is the sample XML file from which I want to extract the data of which availabity ="Available" using php. The XML file will be generated dynamically from the URL http://www.upc.nl/zipcode.php?zipcode=3565BG <UPC-Results> <DateTime>05-12-2005 02:08:26</DateTime> <Errors/> <Products> <Product name="CaTV" availability="NotAvailable"/> <Product name="Chello Starter" availability="NotAvailable"/> <Product name="Chello Easy" availability="NotAvailable"/> <Product name="Chello Light" availability="NotAvailable"/> <Product name="Digitale telefonie FreeTime" availability="NotAvailable"/> <Product name="Chello Classic on DSL" availability="Available"/> <Product name="Chello Plus on DSL" availability="Available"/> <Product name="Chello Extreme on DSL" availability="Available"/> <Product name="Digitale telefonie Basis on DSL" availability="Available"/> <Product name="Digitale telefonie FreeTime on DSL" availability="Available"/> </Products> </UPC-Results> from the above XML, I need to get data of Product name which has the status of "Available"
Extracting First Character
I was wondering how would I extract the first letter or number of a string. Like if the string was "Goat Chesse" only extract the "G".
Extracting Words
I'd like to extract the first 5 words from a blurb of text. I can't find an easy way to do that. Example. If I were to do that for this message I'd extract "I'd like to extract the"
Extracting XML & RDF Data Using PHP
I have an XML file that contains metadata in the form of RDF. The file is something like this: <?xml version="1.0" encoding="utf-8" ?> <xmpData> <WavXmpInfo path="C:.....................................") <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xmpDM="http://ns.adobe.com/xmp/1.0/ DynamicMedia/" xmlns:xap="http://ns.adobe.com/xap/1.0/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:xapRights="http://ns.adobe.com/xap/1.0/rights/" xmlns:dc="http:// purl.org/dc/elements/1.1/" xmpDM:audioSampleRate="16000" xmpDM:audioSampleType="8-bit" xmpDM:audioChannelType="1" .......... .......... .......... <dc:rights> <rdf:Alt> <rdf:li xml:lang="x-default">HHHHHHHHHHHHHH</rdf:li> </rdf:Alt> </dc:rights> </rdf:Description> </rdf:RDF> </WavXmpInfo> </xmpData> I want to extract data such as audioSampleRate, audiosampleType etc, so that i can insert them into a database. I'm having problems accessing this data. I'm using DOMXML. Can this type of data be extracted using DOMXML? If not how would one go about accessing it?
Help With Extracting Please Folks.!
I have this: a variable like: <a href="http://www.some_html.com/text.html" >some text</a><br> I heed to extract the "http://www.some_html.com/text.html " and put it in var "link" And extract "some text" and put it var "text",. So basically extract all between <a href=" and " > plus extract all between " > and </a><br>.
Extracting Information
Does anyone know where I should start with this. Im trying to extract the information in: $_SERVER['HTTP_USER_AGENT' But I dont know how to get the information out? What functions should I be looking at. I want to get the OS, Browser, IP etc..
Extracting A Rar File
i try to extract a rar file via php but i get an error: Fatal error: Call to undefined function: rar_open() in --parksdiary.com/httpdocs/rar2.php on line 8 Code:
Extracting Data From XML
What I want to do is extract data from an XML file and store it as a variable for writing to a MySQL database. I have read many google-found tutorials, but none of them seem to work/do what I want.
|