11-24-2008
Thanks Koneark,
but i have one more prob here.
when i run
echo "today--RSS_URL=http://someurl" | sed 's/\(.*\)--\(.*\)=\(.*\)/x1=\1\nx2=\2\nx3=\3/'
it is giving the out as below.
x1=todaynx2=RSS_URLnx3=http://someurl
But I need the out put as
x1=today
x2=RSS_URL
x3=http://someurl
and i need to export these x1, x2 and x3 to the shell.
Thanks,
Eswar
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file which contains several lines. Sample content of the file is as below.
OK testmessage email<test@123>
NOK receivemessage email<123@test>
NOK receivemessage email(123@test123)
NOK receivemessage email<abc@test>
i would like to know by scripting will... (10 Replies)
Discussion started by: ramasar
10 Replies
2. Shell Programming and Scripting
Input
#GEO-1-type-1-fwd-Initial 890 1519
OPKHIJEFVTEFVHIJEFVOPKHIJTOPKEFVHIJTEFVOPKOPKHIJHIJHIJTTOPKHIJHIJEFVEFVOPKHIJOPKHIJOPKEFVEFVOPKHIJHIJEFVHIJHIJEFVTHIJOPKOPKTEFVEFVEFVOPKHIJOPKOPKHIJTTEFVEFVTEFV
#GEO-1-type-2-fwd-Terminal 1572 2030... (7 Replies)
Discussion started by: patrick87
7 Replies
3. Shell Programming and Scripting
Hi all,
I am trying to extract the values ( text between the xml tags) based on the Order Number.
here is the sample input
<?xml version="1.0" encoding="UTF-8"?>
<NJCustomer>
<Header>
<MessageIdentifier>Y504173382</MessageIdentifier>
... (13 Replies)
Discussion started by: oky
13 Replies
4. Shell Programming and Scripting
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies
5. Shell Programming and Scripting
I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported
Input file is a free flowing file without any format
example of output
ERR-00001=5
....
ERR-01010=10
.....
ERR-99999=10 (4 Replies)
Discussion started by: swayam123
4 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I am able to get next line if it is matching a particular pattern. But i need a way to skip if next line also matches same pattern..
For example:
No Records
No Records
Records found
got it
Records found
Now i want to find 'Records found' after 'No Records' pattern matches..
... (5 Replies)
Discussion started by: nagpa531
5 Replies
7. Shell Programming and Scripting
Hi there, I am pretty new to those things, so I couldn't figure out how to solve this, and if it is actually that easy. just found that awk could help:(.
so i have a textfile with strings and numbers (originally copy pasted from word, therefore some empty cells) in the following structure:
SC... (9 Replies)
Discussion started by: luja
9 Replies
8. UNIX for Advanced & Expert Users
Hi All,
I have a file which is like below. I need to read all the patterns that starts with P and then replace the 9 digit values to 8 digit values (remove leading integer). Can you please help
Example : ( Please look below File)
File :
P,1
M1,... (7 Replies)
Discussion started by: arunkumar_mca
7 Replies
9. Shell Programming and Scripting
Using the file below, which will always have the first indicated by the digit after the -
and last id in it, indicated by the digit after the -, I am trying to use awk
to print the missing line or lines in file following the pattern of the previous line.
For example, in the file below the next... (4 Replies)
Discussion started by: cmccabe
4 Replies
10. Shell Programming and Scripting
Experts,
Need your support for this awk script.
we have only one input file, all these column 1 and column 2 are in same file and have to do lookup for values in one file(column1 and column2) but output we need in another file
Need to grep row whose string contains 9K from column 1. When found... (6 Replies)
Discussion started by: as7951
6 Replies
LEARN ABOUT PHP
str_word_count
STR_WORD_COUNT(3) 1 STR_WORD_COUNT(3)
str_word_count - Return information about words used in a string
SYNOPSIS
mixed str_word_count (string $string, [int $format], [string $charlist])
DESCRIPTION
Counts the number of words inside $string. If the optional $format is not specified, then the return value will be an integer representing
the number of words found. In the event the $format is specified, the return value will be an array, content of which is dependent on the
$format. The possible value for the $format and the resultant outputs are listed below.
For the purpose of this function, 'word' is defined as a locale dependent string containing alphabetic characters, which also may contain,
but not start with "'" and "-" characters.
PARAMETERS
o $string
- The string
o $format
- Specify the return value of this function. The current supported values are:
o 0 - returns the number of words found
o 1 - returns an array containing all the words found inside the $string
o 2 - returns an associative array, where the key is the numeric position of the word inside the $string and the value is the
actual word itself
o $charlist
- A list of additional characters which will be considered as 'word'
RETURN VALUES
Returns an array or an integer, depending on the $format chosen.
CHANGELOG
+--------+--------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+--------------------------------+
| 5.1.0 | |
| | |
| | Added the $charlist parameter |
| | |
+--------+--------------------------------+
EXAMPLES
Example #1
A str_word_count(3) example
<?php
$str = "Hello fri3nd, you're
looking good today!";
print_r(str_word_count($str, 1));
print_r(str_word_count($str, 2));
print_r(str_word_count($str, 1, 'aaac3'));
echo str_word_count($str);
?>
The above example will output:
Array
(
[0] => Hello
[1] => fri
[2] => nd
[3] => you're
[4] => looking
[5] => good
[6] => today
)
Array
(
[0] => Hello
[6] => fri
[10] => nd
[14] => you're
[29] => looking
[46] => good
[51] => today
)
Array
(
[0] => Hello
[1] => fri3nd
[2] => you're
[3] => looking
[4] => good
[5] => today
)
7
SEE ALSO
explode(3), preg_split(3), split(3), count_chars(3), substr_count(3).
PHP Documentation Group STR_WORD_COUNT(3)