Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Search :: Read Files And Just Pick Out Certain Words


I wanted to know if there is a way with PHP to read files and just pick out certain words. For example, I have an essay paper and I want to see if with php I can find out how many times I said the word "for".




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Search For Words Within The Text Of The PDF Files.
I have an online library of PDF files. Each PDF is roughly 500 pages. We would like to be able to search for words within the text of the PDF files. The PDF files will be searched across author, publication year, etc. Does anyone have any good tips/examples of how I might attempt to accomplish this?

I had thought about using pdftotext to convert each pdf to a text file and then using grep to pull the words, but I think there is probably a better way of doing it.

View Replies !   View Related
Perform Search Onto Words And Display The 2 Words
so far on page one it takes word from text box and produces search on datebase for that word then produces correctly over the folling pages using pagination. question is i want it to now perform search onto words and display the 2 words. code is below. :_

$carrymake = (isset($_POST['carrymake']))? $_POST['carrymake'] : $_GET['carrymake'];

$carrymodal = (isset($_POST[carrymodal ]))? $_POST[carrymodal ] : $_GET[carrymodal ];

i want to know now how to include the second varible in this code here:-

// Build Previous Link
if($page > 1){
$prev = ($page - 1);
echo '<a href="'.$_SERVER['PHP_SELF'].'?page='.$prev.'&carrymake='.$carrymake.'"><<Previous</a>&nbsp;'
}

View Replies !   View Related
Search The SQL Table Based On Entered Search Words
1. use LIKE and wildcard:

.....where field1 LIKE "%$searchword%";

2. use regular expression:
.....where field1 REGEXP '[[:<:]]$searchword[[:>:]]'";

3. use mysql's full-text searching

Are there any other methods? I would like to make sure that I know all the possible options so I could choose one that works best in my case.

View Replies !   View Related
Max Words...then Read More
I have selected a large body of text out of my database and what to only show 200 words, then show a read more link. How can I apply this limit?

View Replies !   View Related
Search For Words
I'm trying to write a quick search script which will search for mutiple words in MySQL. The search works fine for one word or if the words are in sequence or phrase. I've tried taking the entered form string and using explode to split the string by spaces, then using foreach to query the database.

View Replies !   View Related
Better Search Words
I have for example the word 'spider-man 3' or 'mr. bean' in my database.

Is it possible to find the corresponding id's when the search string is without punctuation marks like searching with the string: 'spiderman' or 'mr bean'?

I'm trying to accomplish it by using MATHC AGAINST, also in BOOLEAN MODE but with no success.

View Replies !   View Related
Format Search Words
Hi there,

I need format script.php?s=word1+word2+word3
passed into a script as 'word1','word2','word3'

View Replies !   View Related
Search Multiple Words?
in my search if i do 1 word say: graham it searches and find it ok but if there is characters in between them say

graham-another word.another word the characters after the work seem to bring back no results

basically i just need to search the word graham to get results the minute i put 2 or more words together the reults bring back nothing

is there a way to be able to search multiple words?

code: part of the query

$search_query .= "WHERE (`file_name` LIKE '%$keywords%' OR `file_name` LIKE '%$keywords%')";

View Replies !   View Related
Search With Multiple Words Only?
Simply put I want the search to produce only the results with Every word in the search requested.

For example. If a user types in 2005 Barry Bonds. (This is a sports auction site) I only want the query to produce auctions that have <b>all</b>3 words in them in any order. As it stands I get results with 2005 and barry and bonds. I need to narrow the search.

View Replies !   View Related
Search The Database For Key Words?
I have a table in my database called info. In this table there is a field named keywords. The keywords in this field are seperated by a comma and a space (example: 'dog, black, fuffy, cute'). I have a form on a page called seachform.php that posts the variable $keywords to a page named search.php.

This is where I'm stuck. How do I search the database for key words? I'm not sure hoe to write the SQL query or how to handle the post if the user enters more than one word such as 'black dog'.

View Replies !   View Related
Filtering Words In Search
I have a search script that searches my database using mysql's "LIKE"... I want to filter out words such as "a, the, is, as, I" I can't think of them all off the top of my head and was wondering if anyone had a list laying around somewhere?

View Replies !   View Related
MySQL Allows Multiple Words To Search
I need a search that allows multiple words. I got started on the following by code others posted here before.

$search = 'S 1'

$searcha = Array();
$searcha = explode(" ", $search);
$query = "select * from Story where 1=1 ";
reset($searcha);
while (list($key, $val) = each($searcha)) {$query.= "and Description LIKE '%$val%'";
}

Description is a field in my table that contains the description of the story and the story number. ("This story is about garden planting, S 18"). Basically, the code works fine. The thing is when I search for "S 1" (story number 1), because of the "LIKE '%$val%'" clause, the query will basically return everything that starts with a "S" and everything that starts with an "1". So even though I search for "S 1", "S 18" will come up as well.

View Replies !   View Related
Search Database For Two Words In A Field?
Is this possible? Say the table is :

ID string
01 apple orange pear
02 apple banana
03 orange banana mango pear

Code:

View Replies !   View Related
Multiple Words In Search Field
i've got this query that searches a number of fields and returns the results. but how can i get it to consider other words in the query? Code:

View Replies !   View Related
List Of Common Words Mit My Keyword Search?
Seeing if anyone had a list of common words (the,a, as, of,...) so that I can limit my keyword search. I do not want to use the length of the word to limit.

View Replies !   View Related
MySQL Search Function With Multiple Words
I'm using a search function I found online, and I modified it to fit in with my website. Now, I can pretty much understand everything it does, except for this one part, and this part seems to be the problem.

When I enter a search, and it searches articles by their title, it will only return one word titles. Anything with multiple words, even if it's the exact same as the title in the database won't come up. Code:

View Replies !   View Related
Str_replace To Remove Words From Search Phrase
I'm trying to use str_replace to remove certain words from search terms with my website search. For example, when the user enters "term and word", it would remove "and" and only search for "term" and "word". I have the following list of words I want to remove:

"And", "Or", "If", "We", "An", "A", "I"

The problem is that if the user enters something like "Anderson", the term would be replaced with "erson" because the and is removed. Is there a way to remove only certain letters when they are by themselves? For example, change "Anderson and Bill" to "Anderson", "Bill" instead of "erson", "Bill".

View Replies !   View Related
FULLTEXT Search - Error When Searching 3 Character Words
I'm having an error when searching 3 character words. For instance, if I had a description "ball point pen" it would yield a result. However, if I search "pen" no results are found. Is this a php.ini setting?

View Replies !   View Related
How Do I Create A Php Search Engine Which Allows The User To Input Few Words ?
i created a search engine but it can only search one word... How do i create a php search engine which allows the user to input multiple words  ?

View Replies !   View Related
Multidimensional Arrays - Search A Body Of Text And Replace Certain Words
I'm trying to write a program that will search a body of text and replace certain words (say, A, B, and C) with different words that I think are more appropriate (A1, B1 and C1). I have a feeling that I need to do this through a multidimensional array. Am I on the right track?

View Replies !   View Related
Ranking MySQL Result By Number Of Matching Fields Against Search Words
i am adding a search capability in my webpage, i need to search for words selected by users using buttons in a form. i use this cause they will be searching for a word per field on the table.

my query will be somethign like this:

SELECT t1.f1, t1.f2, t1.f3, t1.f4 from t1 where t1.f1="red" ¦¦ t1.f2="manual" ¦¦ t1.f3="4WD" ¦¦ t1.f4"new";

the query work fine but the results are not sorted by number of matches, example if car1 is red, manual, 4WD, and new it should be the first one cause its "score" in matches is 4, then car2 if "score" is 3 will come next in the list, those with only one matching field will be the last ones, of course if no matching fields the car will not be in the results. Code:

View Replies !   View Related
Search Engine :: Search Files On Server From Meta Tags
does anyone know of a good php search engine script that will search files on my server from there meta tag. or any anything else.

View Replies !   View Related
Parsing Some Text Files That Have All The Spacing Between Words Doubled.
I am parsing some text files that have all the spacing between words
doubled. The space between characters is one instead of zero, and the
space between words is two instead of one.

I am trying to create a regular expression that replaces the single
space between the characters in the words with no space. Something
like preg_replace('/.s.','',$string).

View Replies !   View Related
Search Engine Bots Read PHP
Is there any possible way that search engine bots can read and index raw PHP code? I'm not sure. But, I've read that it is possible to search for code of vulnerable PHP websites through google search. I guess it is possible to search for PHP code since google indexes raw PHP code?

View Replies !   View Related
How To Read Tar.gz Files From Php
I need to deflate a tar.gz file, using php, and i have no shell access,
please, im using php 4.3.11 on a iis 5.0 (i know, i sucks).

View Replies !   View Related
Read All Files
I am trying to chmod all my images in one dir. but I cannot get it to work...How do I code the first part so it reads all my files I have in the dir? I want to change all my images cmod settings by running the script once.

$file = all my files in my images folder or this directory

$old = umask(0);
chmod("$file", 0644);
umask($old);

// Checking
if ($old != umask()) {
die('An error occured while changing back the umask');
}

View Replies !   View Related
How To Read Pdf Files?
I have a batch of pdf files need to be convert to html. Is there good script or library can do that? I made some research, most of them only do another way (convert html to pdf)

View Replies !   View Related
How Can I Read .doc Files
Here is a small doubt with which iam struggling,The problem is
how can i read .doc files and display content in browser in php.ok i
have done it with file() and file _get_contents() but iam getting
content with some meta characters like boxes etc. please solve this
problem and reply me immediately it i surgent.

View Replies !   View Related
Read Log Files
I have a client doing some minor PHP development on my server, and they've asked for access to the apache error log to debug. I don't want to give them shell access, so I thought AJAX/PHP might be able to read and refresh the last 50 lines or so of the log file for them to view on the web.

View Replies !   View Related
How Can I Read Text From PDF Files?
Can you someone tell me how can I read text from PDF files?

View Replies !   View Related
Can Php Read .xls Files Directly?
I'd like to be able to read a microsoft spreadsheet with php. I know that php can read mysql, so I was thinking that maybe it could read excel spreadsheets as well.

Does anyone know if that can be done?

View Replies !   View Related
Read Multiple Files
I have a PHP script where I read parts of xml feeds from multiple web addresses and display data. Something like :

for(){
$filedata = @file(url);
parse xml -> display data
}

My problem : can I read more files at once (multithreading?) - because it seems to work very slow now.

View Replies !   View Related
Using PHP To Read XL Spreadsheet Files?
Is there a simple way to read the content of uploaded Microsoft XL
spreadsheet files?

View Replies !   View Related
Read Dirs And Files
I have this code which reads all the folders and files within the path. Code:

$path = getcwd();
read_dir($path);
}

function read_dir($dir) {
$path = opendir($dir);
while (($element = readdir($path)) !== false) {
if($element != "." && $element != "..") {

if(is_dir($dir."/".$element)) {
$dirs[]=$dir."/".$element; // put all folders in CWD into an array
$folders[] = $element;
}
if(is_file($dir."/".$element)) {
$files[]=$element; // put all files in CWD into an array
}
when reading the files.

View Replies !   View Related
Read All Files From A Directory?
how to read all files from a directory and put them in a table?

View Replies !   View Related
Script To Read Files
i am trying to place a file in a user secure area, so when they go to 'My Account' i can place system message, files etc that only that user will see.

i have a table idx_link_user and in that table a field called 'files'. how would i go about retrieving the data from database to present to logged in user?

View Replies !   View Related
Read And Extract From CSV Files
I have just given an interview in php and their is my test on php tomorrow. He told me that i will give you 1 csv file and i have to write a php code /find code from internet which. Reads the csv file and its contents, Exract the information from csv and insert into database, generate the Report: i know php but i don't know how to read csv files with tables and data.

View Replies !   View Related
Read Files From Visitor
I've tried, PHP Code:

$fp = fopen('C:ProgrammesyscOnetstat.txt', 'r');

but of course this only reads out the netstat.txt on my server, not from the client. PHP Code:

$fp = fopen('file:////c://Programme//syscOn//netstat.txt', 'r');

didn't worked as well. I just thought it must be possible, because some "1337-pages" can even read out your harddisk-content to an iframe.

View Replies !   View Related
How To Read Files From Directoiries/sub Directories
I am new to PHP and doing a project. I want to read all files from all directories/sub directories starting from the root of the web site. ie. I want to get the root directory programmatically. I am using linux. The purpose of the file reading is to do an internal searching. Could u give me a sample code.

View Replies !   View Related
Access/read Log Files That Are On Different Servers
I am trying to access/read log files that are on different servers (not web servers) to my scripts but don't seem to be able to access them. I get the following error:

Warning: file("IP_Addressdredrent.log") - No such file or directory in c:inetpubwwwrootAutoreportslog_processingcheck_dre_query_log.php on line 15

I am using Windows 2000 and IIS. Code:

View Replies !   View Related
Arrays And Sorting, Read From Files
this is an ecommerce website. the categories are static, but the products are not. what happens is a user clicks on a link, subgroups.php?a=miscellaneous. subgroups either has a=, p=, l=, c= or s= but not more than one.

so, in a folder called 'dat' there are 5 text files: a, p, l, c, s. these contain the products for each category. what i want is a list of products to be read from the correct file and displayed in a tabled list. the files are layed out like this:

miscellaneous|Sticky Tape|MS394
miscellaneous|Scissors|MS012

so, subgroups.php?a=miscellaneous will read a.txt and look for all rows starting with miscellaneous and display them in a table. along with a thumbnail (img/thumbs/MS394.gif or img/thumbs/MS012.gif) and a link to product information (dat/a/miscellaneous/ms394.txt) which will be included on the next page. How can i do this?

View Replies !   View Related
PHP Scripts To Parse/read OE Dbx Files ?
Does anyone know whethere a PHP class or script exists to read messages in
outlook express mail databases ? I can't get OE to auto-save certain
messages to regular files, and doing a manual SaveAs four times a day
becomes a bit of a bore.

Or should I intercept these messages directly from my pop3 mail server.

View Replies !   View Related
Can I At Least Read The Session Files For All Sessions?
Right now, I am attempting to see how many users are "signed on" to my system. Since this is, at best, rather tenuous in a WEB environment, I thought to read the active session variables and see how many sessions there were.

View Replies !   View Related
Read/write Access To All The Files
I recently made a php app for a company that spiders through a server and finds all files of a specified type (html, etc) and then opens the files and does specified things to them. So, the tool needs to be placed on the server and then it needs read/write access to all the files.

It works fine on my local server, but the client says that it fails (message is "failed to write to file" and then it stops). I told him to try it with ALL files and folders set to 777 just for testing purposes and he says that it's still not working. I have no idea what to suggest.

View Replies !   View Related
How Do You Read And Write UTF-8-encoded XML Files In PHP?
I have a very simple XML file I created as a sample:

<?xml version="1.0" encoding="UTF-8" ?>
<stuff>.....

View Replies !   View Related
Can I Use Php To Read From/write To Other Files On Server
I've got a news section on my page and I want people in the company to be able to fill out an online form to add new news stories so that the website looks constantly updated. all the news stories and scrolling abilities are currently in a javascript file which are written out to the page when a user loads the page. So preferably I'm looking to take in information from a form and write that information into my javascript file if that's possible. r if I can't do the above I want to take in information from my form and write to a database or new file then read that from my javascript file with php.

View Replies !   View Related
Is It Possible To Read From The Dir According To The Cration Time Of Files
is it possible to read from the dir according to the cration time of files.

View Replies !   View Related
When A Search Engine Spiders A Page Does It Read The Raw Code Or The Parsed Html?
When a search engine spiders a page does it read the raw code or the parsed html? I ask as I want to confirm if any text retrieved from a database is 'read' not the php code that gets the data.

View Replies !   View Related
Read/write To Excel Or Same Type Of Files.
We need to be able to process invoices through the internet and have the customers be able to download these invoices. We are currently using Excel to do all the information.

I was hoping to be able to use a third party program to generate these files, I have looked into .pdf, and xls files. From what I have read, it is pretty much impossible for me to get a script that will read an xls file, write data from a mysql database to it, then send the file to the customer for them to download/view with the new information.

Is there a different program that works the same that I might be able to use.. or am I stuck trying to make alot of invoicing data look pretty through html tables?

View Replies !   View Related
Ereg, Read The Dir And Print List Of Files.
I have a dir of html files that link to websites, i would like to read the dir
and print a list of those files as a link. Which the script i have does. I
would like to take this one step further and replace the ".html" extension
with ".com" so it winds up being:

View Replies !   View Related
Security Read Write Files And Folders
when i upload files to my webspace i set permission to my files and folders. Im wondering how im unsafe if i grand a folder or file with write permissions to all/everybody. In fact I have the intelligence to understand that ones can places files to my webspace and then execute them. But I dont have the knowledge how to implement it.

How can i write to that folder and files?

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved