Hi,
i'd like to know if the following is possible with a shell script, and can't find the answer in the search.
Suppose i have a logfile build like this:
# 8 :riuyzp1028
# 38 : riuyzp1028
# 25 : riuyvzp1032
# 30 : nlkljpa0202
# 1 : nlklja0205
# 38 : riuyzp1028
# 25 :... (4 Replies)
Hello,
I got a Qstion. Im posting to a phpbb forum with bash and curl.. i have a text file with the following tags that i post to the forum:
$var1
$var2
$var3
How can i with sed or awk put var content from shell script between the ... in the... (7 Replies)
Hi. I'm hoping that someone can help me with a bash script to delete a block of lines from a file.
What I want to do is delete every line between two stings that are the same,
including the line the first string is on but not the second.
(Marked lines to match with !)
For example if I... (2 Replies)
Hi guys, I wonder if it's possible to search for a line containing 2 strings and delete that line and perhaps replace the source file with already deleted line(s).
What I mean is something like this:
sourcefile.txt
line1: something 122344 somethin2 24334 45554676
line2: another something... (6 Replies)
I have some text files in a folder f1 with 10 columns. The first five columns of a file are shown below.
aab abb 263-455 263 455
aab abb 263-455 263 455
aab abb 263-455 263 455
bbb abb 26-455 26 455
bbb abb 26-455 26 455
bbb aka 264-266 264 266
bga bga 230-232 230 ... (10 Replies)
I need that a certain part of the content below excluded
==Image Gallery== followed by <gallery> and the content until </gallery>
test SED1
==Image Gallery==
<gallery>
Image:car1.jpg| Car 1<sup>1</sup>
Imagem: car2.jpg| Car2<sup>2</sup>
</gallery> test SED2
==Image... (5 Replies)
Hi all,
i have the following line in a record file :
retenu=non
demande=non
script=#vtbackup /path=/save/backup/demande
position=140+70
and i want to use Perl regex to have the following output
key : "retenu" value : "non"
key : "demande" value "non"
key : "script" value :... (2 Replies)
Hello,
I have been trying to write a script where I could get awk to delete data before and after a matched pattern.
For eg
Raw data
Start
NAME = John
Age = 35
Occupation = Programmer
City = New York
Certification Completed = No
Salary = 80000
End
Start
NAME = Mary
Age = 25... (2 Replies)
Hello everybody,
I would like modify some strings using sed or another command line with the content file.
For example:
- {fqdn: "server-01" , ip: "server-01"}
- {fqdn: "server-02" , ip: "server-02"}
- {fqdn: "server-03" , ip: "server-03"}
- {fqdn: "server-04" , ip: "server-04"}
My... (4 Replies)
Discussion started by: dco
4 Replies
LEARN ABOUT PHP
get_meta_tags
GET_META_TAGS(3) 1 GET_META_TAGS(3)get_meta_tags - Extracts all meta tag content attributes from a file and returns an arraySYNOPSIS
array get_meta_tags (string $filename, [bool $use_include_path = false])
DESCRIPTION
Opens $filename and parses it line by line for <meta> tags in the file. The parsing stops at </head>.
PARAMETERS
o $filename
- The path to the HTML file, as a string. This can be a local file or an URL.
Example #1
What get_meta_tags(3) parses
<meta name="author" content="name">
<meta name="keywords" content="php documentation">
<meta name="DESCRIPTION" content="a php manual">
<meta name="geo.position" content="49.33;-86.59">
</head> <!-- parsing stops here -->
(pay attention to line endings - PHP uses a native function to parse the input, so a Mac file won't work on Unix).
o $use_include_path
- Setting $use_include_path to TRUE will result in PHP trying to open the file along the standard include path as per the
include_path directive. This is used for local files, not URLs.
RETURN VALUES
Returns an array with all the parsed meta tags.
The value of the name property becomes the key, the value of the content property becomes the value of the returned array, so you can eas-
ily use standard array functions to traverse it or access single values. Special characters in the value of the name property are substi-
tuted with '_', the rest is converted to lower case. If two meta tags have the same name, only the last one is returned.
EXAMPLES
Example #2
What get_meta_tags(3) returns
<?php
// Assuming the above tags are at www.example.com
$tags = get_meta_tags('http://www.example.com/');
// Notice how the keys are all lowercase now, and
// how . was replaced by _ in the key.
echo $tags['author']; // name
echo $tags['keywords']; // php documentation
echo $tags['description']; // a php manual
echo $tags['geo_position']; // 49.33;-86.59
?>
NOTES
Note
Only meta tags with name attributes will be parsed. Quotes are not required.
SEE ALSO htmlentities(3), urlencode(3).
PHP Documentation Group GET_META_TAGS(3)