I have a huge data of the below format
After first 3 letters, i have 9 spaces and after fruit there are no specific fixed space, but it varies accroding to the length of the fruit name.
Now my requirement is like i must get the data like below.
How can i achieve this ?
Thanks
Jay
Last edited by Franklin52; 06-27-2014 at 11:28 AM..
Reason: Replace (code) tags with [code] tags
i want a command for my script!!!
say file consists of character 123 125 127.
i need a query to replace the number 2 with 0
so the output should be 103 105 107.
i use unix-aix (8 Replies)
Hi All,
How to remove a box like special character which appears at the end of a string/line/record. I have no clue what this box like special character is. It is transparent square like box. This appears in a .DAT file at the end of header.
I'm to compare a value in header with a parameter.... (16 Replies)
Hi,
I have a log file generated by a tool which has the following look :
/tmp/releases/directory/datefilename1_release_date.zip
/tmp/releases/directory/datefilename2_release_date.zip
/tmp/releases/directory/datefilename3_release_date.zip... (8 Replies)
Can any one plse help me writing shell script to removing some special character pattern (like / > -------, / > / > ------- etc....as shown below) from the text file ASAP.
/ > -------
<tag-normalization tag-name="EXECSERVPRODUCT" read-only="false" part="body">
... (3 Replies)
Hi Experts,
I have called some.txt with the following content.
oracle HYRDSRVIHUB01 pts/0 TESTIHUB 07-JUN-10 CREATE TABLE
TESTIHUB PHONE ... (12 Replies)
Hello ,
i have a text file like this :
A123 c12AB c32DD aaaa
B123 23DS 12QW bbbb
C123 2GR 3RG cccccc
i want to remove the numbers from second and third column only.
i tried this :
perl -pe 's///g' file.txt > newfile.txt
but it will remove the number from... (7 Replies)
Hello
I've searched here and on the 'net for examples of a script or command line function that will remove the $ character from all file names only that can be done within the directory that contains the file names - which are all html files.
ie, I have a directory that contains html files... (6 Replies)
Hi All,
Need help to grep blank and copy to file. I have a file in below format
dns1dm06_10,
dns2dm02_04,
dbidub,10000000c9a46d0c
gbpuhci,10000000c948b00a
ibtur001,10000000c9a1ccda
yubkbtp1,10000000c93fec5b
I need to copy to all lines which doesn't have wwn >> no-wwn.txt
1... (2 Replies)
Hello
I have this special caracter after retreving rows from sql server:
"....spasses: • Entrem al valort 6050108002811 • El donem..."
I would like a sed command to remove it..or just know it's ascii code in order to replace it into my sql sentence.. Hope some one knows how to do that.... (7 Replies)
Discussion started by: ldiaz2106
7 Replies
LEARN ABOUT PHP
array_walk
ARRAY_WALK(3) 1 ARRAY_WALK(3)array_walk - Apply a user supplied function to every member of an arraySYNOPSIS
bool array_walk NULL (array &$array, callable $callback, [mixed $userdata])
DESCRIPTION
Applies the user-defined $callback function to each element of the $array array.
array_walk(3) is not affected by the internal array pointer of $array. array_walk(3) will walk through the entire array regardless of
pointer position.
PARAMETERS
o $array
- The input array.
o $callback
- Typically, $callback takes on two parameters. The $array parameter's value being the first, and the key/index second.
Note
If $callback needs to be working with the actual values of the array, specify the first parameter of $callback as a refer-
ence. Then, any changes made to those elements will be made in the original array itself.
Note
Many internal functions (for example strtolower(3)) will throw a warning if more than the expected number of argument are
passed in and are not usable directly as a $callback.
Only the values of the $array may potentially be changed; its structure cannot be altered, i.e., the programmer cannot add, unset
or reorder elements. If the callback does not respect this requirement, the behavior of this function is undefined, and unpre-
dictable.
o $userdata
- If the optional $userdata parameter is supplied, it will be passed as the third parameter to the $callback.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
ERRORS /EXCEPTIONS
If function $callback requires more parameters than given to it, an error of level E_WARNING will be generated each time array_walk(3)
calls $callback.
EXAMPLES
Example #1
array_walk(3) example
<?php
$fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple");
function test_alter(&$item1, $key, $prefix)
{
$item1 = "$prefix: $item1";
}
function test_print($item2, $key)
{
echo "$key. $item2<br />
";
}
echo "Before ...:
";
array_walk($fruits, 'test_print');
array_walk($fruits, 'test_alter', 'fruit');
echo "... and after:
";
array_walk($fruits, 'test_print');
?>
The above example will output:
Before ...:
d. lemon
a. orange
b. banana
c. apple
d. fruit: lemon
a. fruit: orange
b. fruit: banana
c. fruit: apple
SEE ALSO array_walk_recursive(3), iterator_apply(3), list(3), each(3), call_user_func_array(3), array_map(3), information about the callback type,
foreach.
PHP Documentation Group ARRAY_WALK(3)