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.





How To Parse A Doc File To Get Specific String


i want to parse a doc file like a resume or cv and just take out the value of name or a email id can nybdy pls tell me or give me the reexp to just extract the name or mail id fron the whole contents of doc file.




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Parse An HTML File Using Php To Get Some Specific Info
I want to parse an HTML file using php to get some specific info from that page. How do i get started? Do u have any tutorials about it?

View Replies !   View Related
Help Please: Insert String Into File At Specific Location
I want to open a file and write some string between the the 3rd line and the
4th line. my code (as follows) can insert after the 3rd line but somehow it
owerwrites the 4th line. So i lost its original content. As my original file has more than 10000 lines of code, I'm looking for a handy way to do that.

$content = "new content here"
$handle = fopen("test.wrl", "r+"); //open file
$theData = "";
$i = 1;
while($i<4){
$theData += fgets($handle);
$i++;
}
fputs($handle, $content); //write
fclose($handle); //close it

View Replies !   View Related
Parse A Txt File And Replace Each (newline) By A String
i want to aparse a txt file and to replace each new line by a string like (+) for example:
this text:

ahahah
jhtd
bgt

become:
ahahah+jhtd+bgt

View Replies !   View Related
Using PHP To Parse Emails And Print To Specific Printer
We're trying to write a script that will monitor 6 email addresses and
if an email arrives it will print to a specific network printer based
on the email address. So if the address is 'department1@domain.com' it
will print to 'dept1ptr'. Each printer can be setup either on a
network print server or printed to directly via IP address... they're
all HP printers.

Any suggestions on a route to go with this? I'm very familiar with PHP
but I've never written a script to do something like this... and if PHP
isn't the right avenue to take, I'd love other options.

View Replies !   View Related
Parse Part Of String (mid String Function ?)
Can someone tell me how to parse part of a string? I can use the following:

<?php
$text = $_SERVER['PHP_SELF']; //$PHP_SELF //(document.url);
echo $text;
?>

to get this result:

"Your currently at /test.php "

I just want to get "test.php " without the dash. I also need to parse out
parts of other strings. I know how to use Mid(), Left(), and Right() in VB,
but no clue for PHP.

View Replies !   View Related
Rtrim() A Specific String
Is it possible to trim a specific string of characters from the end of an existing string? I know you can use rtrim() to strip characters off, but rtrim() reads a character, one at a time, comparing it to the end of the string. I want to eliminate an entire string (and ONLY that string) from the end of the string in question.

Example:

I have a string that looks like this:
2:E,9,4:B+C,5-D,6:C+G&D,12:0+E,8:E

I want to trim ,9,4:B+C,5-D,6:C+G&D,12:0+E,8:E off the end so that it leaves only 2:E. However, if I did rtrim($string,',9,4:B+C,5-D,6:C+G&D,12:0+E,8:E'); It would eat up everything, because "2," ":," and "E," are all contained in the trim parameters. Does that make sense? I'm basically looking for a literal trim kind of function.

View Replies !   View Related
Capture A Specific String
I have a data and i put it all together inside a variable called DATA, this is what inside of $DATA after i gather all the data that i needed.

$DATA = "
copyright of me and you 2007 and the others bread 15.22 44.97% crumbs 15.532 6.47% apple 146.932 6.555% coffe 83.72 6.537% thank you all friend and everyone data date and year 2007 ";

i need to only capture this data and remove the others:
bread 15.22 44.97% crumbs 15.532 6.47% apple 146.932 6.555% coffe 83.72 6.537%
and split it and make each data inside another variable, like this :

$a = bread 15.22 44.97%
$b = crumbs 15.532 6.47%
$c = apple 146.932 6.555%
$d = coffe 83.72 6.537%

can this be done? and also the data that i try to capture is random, but always with this type : letter - number - number like bread - 15.22 - 44.97% .

View Replies !   View Related
Extract A Specific String
What function can extract a string from another one: I have the string "ABABA [FUNC:variable text] ABABA [FUNC:variable text]". I need to extract the text "variable text". Since "variable text" is variable, I can't use the regular string functions. I need somthing with regex, that will use the pattern :'[FUNC:.*]' I am sure there is a generic function in php.

View Replies !   View Related
Parsing And Rearranging A Specific String
I want to break up a string and rearrange it. I'm tearing a date apart and remaking the format. I need to be able to change: 10/30/2003 18:00:00to2003-10-30 18:00:00

Or, in abstract terms (and it needs to be abstract so it can work on any date in this format that needs to be modified): XX/YY/ZZZZ AA:BB:CCtoZZZZ-XX-YY AA:BB:CC

The date will always be in this extact syntax, there doesn't need to be any error checking for it. Zeros are filled in, so AA:BB:CC is always 2 degits each, as are XX and YY.

View Replies !   View Related
How Do You Pull Specific Characters In From A $string
I want to create a method that will tell me the 10th and 11th character
in a string, and store it as $something. How can this be done?


View Replies !   View Related
Pulling Specific Data Out Of A String...
I have a string of data that I've stored in a variable $textSting.  Now, I want to make that $textString variable be only the first 20 characters AFTER the 12th character (so, characters 13-33). 

Here's some other things to note: The string will always have at least 12 characters, so cutting out the first twelve will always be an optionThe string may not have up to 20 characters that follow the 12th character - there may be any number less than thatIf the string has less than or equal to 20 characters after the 12th character, then I just need the total rest of the chacaters. 

So, if there's 30 characters total, I'd want to cut out the first twelve, then display all of the remaining 18.If there are MORE than 20 characters, then after the 20 are displayed, I'd like to tack on "..." to the end of the last character.

View Replies !   View Related
Can A String Be Searched For Specific Characters?
Can a string be searched for specific characters? Each time a 6 is found, can "Six" be displayed on the screen, and each time a 5 is found, can "Five" be displayed on the screen.

View Replies !   View Related
Limit String To Specific Number Of Lines
I was wondering how I would go about setting the number of lines for a string.  For instance, if I have:

This
Is
Just
A
Test

Say I just have room for 3 lines, I want it to say on the page:

This
Is
Just
- click here to read the entire string

The reason for this is I want to create a news section on the main page, that has the brief story and then click the link to go to the full story.

View Replies !   View Related
Blocking A Specific String From Being Blocked From Submittion
I have a small advertising script that will advertise a link on the main page of my site, what I'm wondering is how I can block a link from being submitted, what I currently have is an if statement that will not allow a specific link, but it is case sensitive.

so for example, if I want to block site1.com, the user can submit SITE1.com, or sItE1.com, SiTE1.com, etc.. and they would all go through fine. How can I have it so that it doesn't matter the case, it will block the whole site1.com, no matter what the case is?

OR, an alternative I was thinking about is forcing all letters to go lower case, is that a possibility in php?

View Replies !   View Related
Recursively Searching Array For Specific String
Simply put, I'd like to find a string such as &#65533;' in an array. The string is not strictly &#65533;', but would be 508429_501_21.jpg, 508429_601_18.jpg, etc. - multiple occurences are possible. I found a great function that recursively scans through a directory structure; I've attached it here, and it results in the following output. Code:

View Replies !   View Related
Search A String For A Specific-size Integer.
I need to search a string for a specific-size integer. For example, the string would be: "This is my string 123456789 and it contains an integer." In all my string values, the integers are all exactly 10 digits in length, and there are no other occurrences of this length integers. I would like to figure out a PHP function to search for any 10-digit-length integers in the string.

View Replies !   View Related
Can You Check A Query String Variable For A Specific Path?
Is there anyway to look for a specific path in a variable sent by a query string? Example:

http://www.domain.com/page1.php?pid=http://www.domain.com/pic1.jpg

Is the any way to make sure that "domain.com" is somewhere in the "pid" query string variable? Otherwise if it is not; use a header too go somewhere else. Code:

View Replies !   View Related
Parse A String With PHP
Just a quick question on something I can't figure out to do with PHP!

Case 1:
$text = "You worked at the local bar and made $1456 for the night";

Case 2:
$text2 = "You worked at the local shop and made $5831 for the day";

Im looking for the following result:
Case 1:
$worked = "bar";
$wage = "$1456";

Case 2:
$worked = "shop";
$wage = "$5831";

View Replies !   View Related
Parse A String Out
I'm trying to parse a string out. From the URL I manged to get the size. Code:

if (powerpoint_size=="small") {
psizeW="320";
psizeH="148";
powerpointAddress = "http://www.testurls.com/powerpoint.320.ppt";
embedPowerPoint(powerpointAddress, psizeW, psizeH);
} else if (powerpoint_size == "medium") {
psizeW="480";
psizeH="216";
powerpointAddress = "http://www.testurls.com/powerpoint.480.ppt";
embedPowerPoint(powerpointAddress, psizeW, psizeH);
} else if (powerpoint_size == "fullsize") {
psizeW="640";
psizeH="284";
powerpointAddress = "http://www.testurls.com/powerpoint.640.ppt";
embedPowerPoint(powerpointAddress, psizeW, psizeH);
...................

View Replies !   View Related
Parse A String For Certain Words
I was wondering if php can parse a text string for certain words and
return "true" if that word is found. For example, I have a string like this:

$string = "The rain in spain is the same as the rain on the plain";

I want to run a php command(s) that will parse the sentence and return true
if, for example, the word "spain" is found.

View Replies !   View Related
IMAP To Parse String
I currently have incoming email piped to a php script using a .forward file. I would like to be able to parse the incoming mail, perform operations, and then fire back an email (immediately) to the sender. Is there any way that I can use the php IMAP functions on either the php://stdin stream (the means through which the email is piped as raw text) or on a plain string? If not, are there any recommendations for what I can use to parse an incoming email which may or may not be MIME?

View Replies !   View Related
Parse / Split String
I'm trying to parse/split the following text using preg_replace and haven't had too much luck so far.

String = string is surrounded by other text and also contains the brackets exactly as shown. I would like to do something like this with it:

<a href="http://www.domain.com/please parse">this part</a>

View Replies !   View Related
Parse Query String Question
Hello, I have a querystring (&amt=138.06&opt=none), and I dont know how to read these passed variables. For example, where my querystring says "&amt=138.06" I cannot read these variables in my php script as $amt , or . $amt....these give me a parse error.

When I do this:
$data = $HTTP_SERVER_VARS['QUERY_STRING'];
echo $data;

It outputs the complete querystring-- can anybody please suggest some code to extract the value of "amt" from $data?

View Replies !   View Related
Parse A String With An Email Address
I need to parse a string with an embedded email address.
The string always has the format NAME (name@domain) SOMETEXT.
What I need to get is the email address as name@domain.

I came up with this (I know it's broken, but it's a first start):

<?php

function ParseTicketEmail($ticket)
{
global $TicketEmail;
for ($i=0; $i< strlen($ticket); $i++){
//we need to pass everything between ( and ) to $TicketEmail nothing else
do {
$ticket[$i] = $discarded;
} while ($ticket[$i] != '(');
while ($ticket[$i] != ')'){
$TicketEmail = $TicketEmail . $ticket[$i];
}
}
return $TicketEmail;
}

$ticket = "hello (world@world.com) bla";
print "$TicketEmail";
print "$discarded";
?>

But that doesn't return anything for either $TicketEmail or $discarded.
So:

a: why doesn't it return anything for either string? (It's too early in the morning here)

b: does anyone have such a function anywhere for me to check out for how to do it?

View Replies !   View Related
Connect String Parse Error
I am getting this error when I use the connection string. I have no trouble connecting to MySQL via telnet, but I cannot connect using PHP connection string?

Parse error: parse error in /connect.php3 on line 3
line 3 is the username.

<?
$hostname = ""
$username = "user"
$password = "pass"
$dbname = "db"
MYSQL_CONNECT($hostname,$username,$password) OR DIE ("Can't Do It");?>

View Replies !   View Related
Parse String , Return Hyperlinks
I have a string with the following information.

$myString= "This is my example string please. Please visit
http://www.mylink.com . More example text goes here. another link
http://www.link2.com . more text.. blah..";

What I'm wanting is a function to return the following string :

$myString= This is my example string please. Please visit <a
href'http://www.mylink.com'>link</a> . More example text goes here.
another link <a href='http://www.link2.com'>link</a> . more text.. blah..";

Each string may contain 0 or more http:// instances. The function would
only parse on an http:// match.

I know this could be done with regular expressions, but I'm not sure how
to insert the modified data back into the original string at the correct
location.

View Replies !   View Related
Parse An Alpha Num String For Validation.
I am needing to parse an alpha num string for validation. The string needs to always begin with one (1) alpha character (A - L only) then be followed by eight (8) numerical characters (0 - 9) and then end with one (1) alpha character (A - Y but not allow the O).
If the string is not in this format I need to kick it back to the form for the user to fix the string. Any ideas on the best way to validate this type of string.

View Replies !   View Related
Another Parse Error, Unexpected T String
Parse error: parse error, unexpected T_STRING in /home/sites/example.co.uk/public_html/checkout.php on line 47

I new to PHP and i'm using WA Ecart and DW MX2004 to create a very simple shop. For learning purposes. The checkout page seems to have a error on line 47 which is the submit button. My code:

View Replies !   View Related
Parse String For Urls, But Not Html Links
I've got this function to convert any urls into the proper links for my CMS. However, if I want to put in my own link <a href="http://www.domain.com">A link to domain.com</a> (rather than the basic url www.domain.com), this function really stuff's it up. Code:

View Replies !   View Related
Parse A Query String To Populate Form...
I have created a Content management System that writes content to flat files. I have a single PHP page that calls/opens each flat file and places its content all around the page.

I want to send a URL to people such as (www.??????.com/whatever.php?flatfile&firstname=mike&lastname=jones) where the "whatever.php is the landing page, the "flatfile" is the name of the text file that supplies the content, the "firstname" and lastname" will populate a form found on the php page. Can this be done? And if so, can you help me out? Code:

View Replies !   View Related
How To Parse Posted Variables To Do Preg_match And String Functions
I know how to parse posted variables to do preg_match and string functions. What I am wondering is if there is a way to parse global variables as a function. I am not too famialiar with functions per say, but I need to learn how to master them in order to finish my project. Here is a sample code php

$name = $_POST["name"];
$favorite = $_POST["favorite"];
$time = $_POST["time"];

echo ?>

What I am trying to do is striptags and preg_match the data to cleanse it. I know how to do that on a variable by variable basis, but I have a total of 31 variables that are user inputed. I hear that php5 has a cleanse function built in, but this is on php4..

View Replies !   View Related
Writing To A Specific Place In A File
I have a text file. I would like to write a line of data as the first
line and then another as the last line. What is the easiest way to do
this using php 4?

View Replies !   View Related
Fwrite At Specific Point In File
I'm doing a little feedback type feature on one of my sites, so a visitor can just type in their name and comment and it's posted to a page (feedback.html) which is displayed in an iframe.

This all works fine and dandy but when I write to the feedback.html page the new comments obviously go on the bottom, so that after a few feedback comments have come in you need to scroll down to read the new ones, so I would like it so that it posts the new comments at the start of the new file. This can't be literally the start though, as the feedback.html has three lines of headers, or 84 characters.

So what I need is a way to point the file pointer at the 85th character or the fourth line and perform the fwrite there. I've tried using fseek but haven't had any joy with that. Does anybody know what I'm talking about and is anyone able to help?

View Replies !   View Related
Retrieving Specific File Info...
Ive got a file which contains the following data:

<option value="13">African Nations Cup XXV</option>
<option value="16">asd</option>
<option value="7">Champions League</option>
<option value="1">English Premiership</option>

What Id like to do is get the maximum value, so 16. Ive used file_get_contents to bring the file into a string, but now Im stuck getting that max value out. Unless theres a function for this, I believe the direction I would need to take is collect all value numbers using some string manipulation function, throw them all into an array, and just get the max value of the array.

Is there an easier way?

View Replies !   View Related
Delete Specific Texts From File
The text file is in variable length. We can't point to where to delete. But there are texts we want to delete in the text. How can I do ?

The only way I can think of is load entire file, match the text we want, replace the text, and then rewrite the file. Is this way correct ?

View Replies !   View Related
Check For Specific File Type
I have been making some code to check how many files I got in a folder. Now I was wondering if it is possible to check how many files of a specific type I got in the folder for example avi, jpg, 3gp and so on. Code:

View Replies !   View Related
Extracting Specific Data From A File
I have a text data file with the following fields.

item and file

Example

item1 | file1
item2 | file2
item3 | file3

How can I get a variable called $item_name to choose and print the file name that's in the same row where the item field matches the $item_name variable. For instance if the $item_name variable is "BOOK NUMBER ONE" and these field values exist

BOOK NUMBER ONE | book_1.pdf

I want to choose and print book_1.pdf.

View Replies !   View Related
Parsing File For Specific Info.
Ok first, I copied the console text from a game I've been playing. Now I want to make a PHP script that will search through the file line by line and check for 'Death Messages' where I've killed someone or where I've been killed.

I want to be able to slice it all up and save who was killer, who was victim, and what the weapon was. Just having trouble coming up with the best way to go about it.. Code:

View Replies !   View Related
Reading Specific Values From A Txt File
I would like to read from a .txt file with php and display only column[3] and column[4] when there is a match in column[0] at a specific row.

Example:

currencies.txt
CAD / Canadian Dollar (CAD) / Canadian Dollars / .22500 / .03680
USD / US Dollar (USD) / US Dollars / .5400 / .5200
AUD / Australian Dollar (AUD) / Australian Dollars / .1324 / .09680
MXN / Mexican Peso (MXN) / Mexican Pesos / .3476 / .2482

There is a match in column[0] at row 3 with AUD, so only the values in column[3] and column[4] at row 3 are displayed (.1324 and .09680). I'm not using MySQL for the database because the txt file will only be about 10 rows, I can't figure this one out, any solutions?

View Replies !   View Related
Specific Word Count From A File
I need to count how many time each specifics words appear in a specific file:
Example file content (.menu): Code:

View Replies !   View Related
Copy File With A Specific Begining Like 'thumb_'
could some help in writing a php code for copying specific files that start with 'thumb_' only and no other file. like we copy files with specific extension i want to copy files with specific starting.

View Replies !   View Related
Putting A File Directory In A Specific Order
I have the code below, looking at the contents of the folder and listing the files, as links to themselves. I would like to be able to control the way they are sorted. It seems very random.

I figured i could write all the file names to an array then have them write to a db, then pull those back from the db. So basically to avoid the extra scripting, is there some way to sort this? Code:

View Replies !   View Related
GoTo Specific Line Number In A File?
I've got a page where I'm displaying images from a directory. The images are labled 1.jpg through 524.jpg. This will never change (i.e. names or numbers of images in this directory).

What i've added is a file that contains 'subtitles' to each image. It's just a text file in this format: Code:

View Replies !   View Related
Read Specific Entry From File Directory
Is there a way to use PHP to read forward from a specific starting point in a directory? Let's say I've opened a directory on a file system, I've read through the first X-number of entries, now I need to go do something else, but I want to come back later in the program and continue reading from the point I left off in the directory. This would be like reading through an array with an index value. Can I do this with a PHP construct of some kind, or do I have to call a shell script.

View Replies !   View Related
How Do You Display SPECIFIC File Types In A Directory On A Web Page Please?
Hello,

I have the following code:

<?php
$handle = opendir('images/');
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "<a href="images/$file">$file</a><br>";
}
}
closedir($handle);
?>

which lists ALL the files in a directory as links on a web page. How do I limit it so it just shows Word documents for example?

View Replies !   View Related
Pulling Date-specific Data From Flat File
I'm almost a complete newbie to using PHP and I was hoping one of you
guys can point me in the right direction. I'm working on a site for a
brand of handmade fruit juice and it only needs one bit of dynamic
content: the info on what fruit is in the juice and where it is coming
from (vendor, country etc.) today and tomorrow (the content of the
juice is different everyday). So I thought it would be easiest to put
that information in a flat file (an Excel file would be ideal but a
plain text would do too) on a weekly basis and try to pull out the
needed info with PHP. Except I don't know how yet. I don't expect any
of you to do the work for me but if someone could point me to which
functions of PHP I should do some research on, I'd be most grateful.

View Replies !   View Related
Include The File On All Your Pages In A Specific Directory Recursivly
I have a configuration file called config.php" that I would like all my pages to have. The problem with it is that I have to include it in all my pages and have to specify the exact directory wherever it's located and I have my files throughout different files in the filesystem and it becomes a tedious job.

So my question is, is there a way to have php include the file on all your pages in a specific directory recursivly or is there an apache setting through .htaccess that can maybe pull this off?

View Replies !   View Related
How To Echo A Single, Specific Line From A Text File
How do I echo a single, specific line from a text file?  Let's say, for example, the second line?

View Replies !   View Related
Search For A Specific Word Inside A Text File?
Basically what i'm trying to do is when a user inputs login/password information at a login page, I want PHP to search inside verify.txt and if it finds the login/password combination then allows the user to proceed. Is this possible? And if so, which functions would I use to get the job done?

Also, how can I save the login name so that it can be passed to/included in a url?

View Replies !   View Related
How To Tell To Send A Specific E-mail At A Specific Time
How to tell PHP to send a specific e-mail at a specific time (newsletter).

View Replies !   View Related
String -> String That Is Compatible With Linux File System.
Does a function excist that converts a string to a string thats compatible
with linux file system?



View Replies !   View Related
Find String In String In File With Repeating Data
I have files with the following data:

*******************
SEQ: [+1]
DTM: [203:20050914:102]
FII: [OR+05407059214]

SEQ: [+2]
DTM: [203:20050915:102]
FII: [OR+05407059999]

SEQ: [+3]
DTM: [203:20050813:102]
FII: [OR+05407099999]

and so on....
*******************

The file could have 1 or 100 sections and I recieve them every day. Code:

View Replies !   View Related

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