sed, awk [TAG]$content[/TAG] How to get var in $content in textfile?
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:
How can i with sed or awk put var content from shell script between the [tags]...[/tags] in the textfile? I tried with awk and sed to replace it. But i just dont get it to work
Hello ,
I have huge file with below content. I need to read the numeric values with in the paranthesis after = sign. Please help me with awk and sed script for it.
11.10.2009 04:02:47 Customer login not found: identifier=(0748502889) prefix=(TEL) serviceCode=().
11.10.2009 04:03:12... (13 Replies)
Hi,
Example File:
(jumped,
bumped,
)
how to
jumped,
FROM tree;
EXIT
I have some hundreads of files like this with the different words and I want to remove the comma before the bracket and also I have to remove the comma before FROM word.
I am trying to use this command :
awk '... (5 Replies)
Hi All,
Find the following code:
<Universal>D38x82j1JJ
</Universal>
I want to retrieve the value of <Universal> tag as below:
Please help me. (3 Replies)
Hi,
Need to replace an XML tag name contents, please provide any suggestions.
Scenario is :
<abc_def>Value_some_content</abc_def>
Expected output :
<abc:def>Value_some_content</abc:def>
We have many tag with different names & contents in a file or a string.
Please help on the... (3 Replies)
I want to print from <fruits> to </fruits> tag which have <fruit> as mango. Also i want both <fruits> and </fruits> in output. Please help
eg.
<fruits>
<fruit id="111">mango<fruit>
.
another 20 lines
.
</fruits> (3 Replies)
Hi Guys
Here is my Input :
<?xml version="1.0" encoding="UTF-8"?>
<xn:MeContext id="01736">
<xn:VsDataContainer id="01736">
<xn:attributes>
<xn:vsDataType>vsDataMeContext</xn:vsDataType>
... (12 Replies)
I want to basically do the below thing. Suppose there is a tag called object1. I want to display an output for all similar tag values under heading of Object 1 and the count of the xmls. Please help
File:
<xml><object1>house</object1><object2>child</object2>... (9 Replies)
Hi Forum.
I have an XML file with the following requirement to move the <AdditionalAccountHolders> tag and its content right after the <accountHolderName> tag within the same file but I'm not sure how to accomplish this through a Unix script.
Any feedback will be greatly appreciated.
... (19 Replies)
I am trying find files in sub dir with certain tags using tag command, and add the period to the beginning. I can't use chflags hidden {} cause it doesn't add period to the beginning of the string for web purpose. So far with my knowledge, I only know mdfind or tag can be used to search files with... (6 Replies)
Discussion started by: Nexeu
6 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)