10-20-2014
EDIT: Nevermind, thats the purpose of your script
Last edited by sea; 10-20-2014 at 10:51 PM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Student have huge interest about why so many expert choose use UNIX than MS Windows.
I consider that SHARE & OPEN is key point.:) (2 Replies)
Discussion started by: 111000
2 Replies
2. Solaris
I need to use tip from machine A serial port to machine B serial port. Can someone point me to an example of the correct cable to use?
Thanks. (1 Reply)
Discussion started by: dangral
1 Replies
3. Shell Programming and Scripting
I am about to do a script that change the COST so i dont need to change each cost.
The output looks like this.
"OL_ID OL_LINK_COST
----------- ------------
51 10
52 10
53 10
54 10
55 ... (3 Replies)
Discussion started by: maskot
3 Replies
4. UNIX for Advanced & Expert Users
Hi,
I have a wiered problem probably unique to me.
if test -f "${LOGDIRE}/Component_Name.sql"
then
echo "<br>Synchronization success<br>"
else
echo "<br>Sorry! Synchronizing failed"
fi
Considering, the file is present always, the above condition returns different outputs in each... (1 Reply)
Discussion started by: Nanu_Manju
1 Replies
5. Solaris
plz explain TIP in solaris in detail. (11 Replies)
Discussion started by: karman0931
11 Replies
6. Shell Programming and Scripting
Hello,
I'm just starting working on it. I'd like to get a tip
For istance if I have a file like:
a b c
d e f
....
and I wanna get:
1a & 2b & 3c
0d & 8e & 4f
.....
I would like to use sed and come up with a regular expression that works.... (3 Replies)
Discussion started by: Dedalus
3 Replies
7. Shell Programming and Scripting
How do I find a key word in multiple files.. in a directory.. ?
cat *.doc | grep -i myword? (7 Replies)
Discussion started by: hamon
7 Replies
8. Shell Programming and Scripting
how do i "awk" the date after the from only to compare it on a if statement later .
filename example:
server1-ips-ultranoob-ok_From_2012_21_12-23:40:23_To_2012_21_12-23:49:45.zip
what i want o do is compare only the date from the string in "From_2012_21_12" in this case i only want the... (4 Replies)
Discussion started by: drd0spt
4 Replies
9. AIX
Read "Migration to POWER8" article to get prepared for migration to POWER8:
link removed, advertisement (0 Replies)
Discussion started by: pave01
0 Replies
10. Shell Programming and Scripting
Often it has been said that echo is neither portable nor correct.
Here is an input.txt:
line1
line2
-n
line4
-en
line6
-x
line8
Then the following fails with BSD/Linux/bash:
while IFS= read line
do
echo "$line"
done < input.txt
It is elegantly improved by means of an echo... (2 Replies)
Discussion started by: MadeInGermany
2 Replies
LEARN ABOUT PHP
simplexml_load_file
SIMPLEXML_LOAD_FILE(3) 1 SIMPLEXML_LOAD_FILE(3)
simplexml_load_file - Interprets an XML file into an object
SYNOPSIS
SimpleXMLElement simplexml_load_file (string $filename, [string $class_name = "SimpleXMLElement"], [int $options], [string $ns = ""],
[bool $is_prefix = false])
DESCRIPTION
Convert the well-formed XML document in the given file to an object.
PARAMETERS
o $filename
- Path to the XML file
Note
Libxml 2 unescapes the URI, so if you want to pass e.g. b&c as the URI parameter a, you have to call sim-
plexml_load_file(rawurlencode('http://example.com/?a=' . urlencode('b&c'))). Since PHP 5.1.0 you don't need to do this
because PHP will do it for you.
o $class_name
- You may use this optional parameter so that simplexml_load_file(3) will return an object of the specified class. That class
should extend the SimpleXMLElement class.
o $options
- Since PHP 5.1.0 and Libxml 2.6.0, you may also use the $options parameter to specify additional Libxml parameters.
o $ns
- Namespace prefix or URI.
o $is_prefix
- TRUE if $ns is a prefix, FALSE if it's a URI; defaults to FALSE.
RETURN VALUES
Returns an object of class SimpleXMLElement with properties containing the data held within the XML document, or FALSE on failure.
ERRORS
/EXCEPTIONS
Produces an E_WARNING error message for each error found in the XML data.
Tip
Use libxml_use_internal_errors(3) to suppress all XML errors, and libxml_get_errors(3) to iterate over them afterwards.
EXAMPLES
Example #1
Interpret an XML document
<?php
// The file test.xml contains an XML document with a root element
// and at least an element /[root]/title.
if (file_exists('test.xml')) {
$xml = simplexml_load_file('test.xml');
print_r($xml);
} else {
exit('Failed to open test.xml.');
}
?>
This script will display, on success:
SimpleXMLElement Object
(
[title] => Example Title
...
)
At this point, you can go about using $xml->title and any other elements.
SEE ALSO
simplexml_load_string(3), SimpleXMLElement::__construct, "Dealing with XML errors", libxml_use_internal_errors(3), "Basic SimpleXML usage".
PHP Documentation Group SIMPLEXML_LOAD_FILE(3)