05-01-2008
Quote:
Originally Posted by
jim mcnamara
Note the change "no -> " no
Next time try using either quote ot code tags around expected output. Thanks.
Aejaz,
pls use the
vB Codes when posting either code samples and/or quoting input/output.
Not doing so makes it very difficult for anyone here to help you.
Thanks.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I've been searching around here and other places, but can't put this together...
I've got a unique list of words in file 1 (one word on each line).
I need to delete each line in file2 that begins with the word in file1.
I started this way, but want to know how to use file1 words instead... (13 Replies)
Discussion started by: michieka
13 Replies
2. Shell Programming and Scripting
11132
13069
11137
11142
13070
Can I use grep command to exclude all lines beginning with 13?
I dont want to use grep -v 13 as potentially there will be a number with something like 11013 that I would exclude in error.. (2 Replies)
Discussion started by: frustrated1
2 Replies
3. Shell Programming and Scripting
I have a file that contains a great number of lines, let's say 183 lines, and I want to add: echo " to the beginning of each line. What is the easiest way to do it?
Tx (9 Replies)
Discussion started by: Ernst
9 Replies
4. Shell Programming and Scripting
Hi!
I store some data obtained with grep or awk in a file. The problem is that some lines have white space at the begining :
line1
line2
line3
I use something like
grep WORD INFILE >> OUTFILE
awk >> OUTFILE
I would love if it were possible to remove the white whitout parsing the... (4 Replies)
Discussion started by: tipi
4 Replies
5. Shell Programming and Scripting
I have a large file which reads like this:
fixed-address 192.168.6.6 {
hardware ethernet 00:22:64:5b:db:b1;
host X;
}
fixed-address 192.168.6.7 {
hardware ethernet 00:22:64:5b:db:b3;
host Y;
}
fixed-address 192.168.6.8 {
hardware ethernet 00:22:64:5b:db:b4;
host A;
}... (4 Replies)
Discussion started by: ksk
4 Replies
6. Solaris
How can we delete all the blank spaces in the beginning of some lines in a text in vi?
Thanks, (2 Replies)
Discussion started by: Pouchie1
2 Replies
7. Shell Programming and Scripting
I'm trying to extract all the lines between 2 strings (including the lines containing the strings)
To make the strings unique I need to include white space if possible. I'm not certain how to do that.
sed -n '/ string1 /,/string2/p' infile > outfile & (4 Replies)
Discussion started by: dcfargo
4 Replies
8. Shell Programming and Scripting
How can I delete spaces at the begining of all lines of my file ? (2 Replies)
Discussion started by: Sara_84
2 Replies
9. Shell Programming and Scripting
hi I am trying to use SED to replace the line matching a pattern using the command
sed 'pattern c\
new line
' <file1 >file 2
I got two questions
1. how do I insert a blank space at the beginning of new line?
2. how do I use this command to execute multiple command using the -e... (5 Replies)
Discussion started by: piynik
5 Replies
10. Shell Programming and Scripting
Hello people,
I am trying with sed to insert some text at the beginning of each odd line of a file but no luck. Can you please help. Awk is also suitable but I am not very familiar with it.
Thank you in advance for any help. (7 Replies)
Discussion started by: drbiloukos
7 Replies
LEARN ABOUT PHP
bbcode_create
BBCODE_CREATE(3) 1 BBCODE_CREATE(3)
bbcode_create - Create a BBCode Resource
SYNOPSIS
resource bbcode_create ([array $bbcode_initial_tags = NULL])
DESCRIPTION
This function returns a new BBCode Resource used to parse BBCode strings.
PARAMETERS
o $bbcode_initial_tags
- An associative array containing the tag names as keys and parameters required to correctly parse BBCode as their value. The fol-
lowing key/value pairs are supported:
o$flags optional - a flag set based on the BBCODE_FLAGS_* constants.
o$type required - an int indicating the type of tag. Use the BBCODE_TYPE_* constants.
o$open_tag required - the HTML replacement string for the open tag.
o$close_tag required - the HTML replacement string for the close tag.
o$default_arg optional - use this value as the default argument if none is provided and tag_type is of type OPTARG.
o$content_handling optional - Gives the callback used for modification of the content. Object Oriented Notation supported
only since 0.10.1 callback prototype is string name
(string $content, string $argument)
o$param_handling optional - Gives the callback used for modification of the argument. Object Oriented Notation supported only
since 0.10.1 callback prototype is string name
(string $content, string $argument)
o$childs optional - List of accepted children for the tag. The format of the list is a comma separated string. If the list
starts with ! it will be the list of rejected children for the tag.
o$parent optional - List of accepted parents for the tag. The format of the list is a comma separated string.
RETURN VALUES
Returns a BBCode_Container
EXAMPLES
Example #1
bbcode_create(3) example
<?php
$arrayBBCode=array(
''=> array('type'=>BBCODE_TYPE_ROOT, 'childs'=>'!i'),
'i'=> array('type'=>BBCODE_TYPE_NOARG, 'open_tag'=>'<i>',
'close_tag'=>'</i>', 'childs'=>'b'),
'url'=> array('type'=>BBCODE_TYPE_OPTARG,
'open_tag'=>'<a href="{PARAM}">', 'close_tag'=>'</a>',
'default_arg'=>'{CONTENT}',
'childs'=>'b,i'),
'img'=> array('type'=>BBCODE_TYPE_NOARG,
'open_tag'=>'<img src="', 'close_tag'=>'" />',
'childs'=>''),
'b'=> array('type'=>BBCODE_TYPE_NOARG, 'open_tag'=>'<b>',
'close_tag'=>'</b>'),
);
$text=<<<EOF
[b]Bold Text[/b]
[i]Italic Text[/i]
[url]http://www.php.net/[/url]
[url=http://pecl.php.net/][b]Content Text[/b][/url]
[img]http://static.php.net/www.php.net/images/php.gif[/img]
[url=http://www.php.net/]
[img]http://static.php.net/www.php.net/images/php.gif[/img]
[/url]
EOF;
$BBHandler=bbcode_create($arrayBBCode);
echo bbcode_parse($BBHandler,$text);
?>
The above example will output:
<b>Bold Text</b>
[i]Italic Text[/i]
<a href="http://www.php.net/">http://www.php.net/</a>
<a href="http://pecl.php.net/"><b>Content Text</b></a>
<img src="http://static.php.net/www.php.net/images/php.gif" />
<a href="http://www.php.net/">
[img]http://static.php.net/www.php.net/images/php.gif[/img]
</a>
PHP Documentation Group BBCODE_CREATE(3)