I need to find <PARAM NAME="GROUP” OP="EQ” VALUE="GRP_04"/>
but update VALUE="Data1"/> (i.e. the line above)
I specifically have to only have to update:
VALUE="Data1"/> when it is followed by <PARAM NAME="GROUP” OP="EQ” VALUE="GRP_04"/>
, because there are many instances of VALUE="Data1"/> that I do want to update in the XML, does that make sense?
in short I need to have a command to replace the line above my search string
Last edited by zxmaus; 12-11-2011 at 11:59 PM..
Reason: added tags
I need to replace the line containing "STAGE_DB" with the line
"STAGE_DB $DB # database that contains the table being loaded ($workingDB)"
Here $DB is passed during the runtime.
How can I do this?
Thanks,
Kousikan (2 Replies)
Hi,
I have a problem. I want to use SED to replace one line with three
It looks like:
PARAM='first_line,second_line,third_line'
And in file:
blablabla
blablabla
PARAM
blablabla
blablabla
blablabla
All I want is to change this into:
blablabla
blablabla
first_line
second_line... (6 Replies)
Hi,
Please help me with the sed command for the following scenario:
I've in abc.txt,
asdasdada<cr>aasdsad<cr><cr>asdasdfsdfs<cr><cr><cr>asdsada<cr>adasd<cr>daasdaasd<cr><cr><cr>
I want a sed command to do
asdasdada<cr>aasdsad<cr>asdasdfsdfs<cr>asdsada<cr>adasd<cr>daasdaasd<cr>
... (13 Replies)
i have few lines in a file... i am reading them in a while loop so a particular line is held is $line1.. consider a modified line is held in $line2.... i want to replace $line1 with $line2 in the same file... how to do it..?
i have come up till the below code
sed "s/$line1/$line2/g" tmpfile.sql... (5 Replies)
Hi How Are you?
I am doing fine!
I need to go now?
I will see you tomorrow!
Basically I need to replace the entire line containing "doing" with a blank line:
I need to the following output:
Hi How Are you?
I need to go now?
I will see you tomorrow!
Thanks in advance.... (1 Reply)
So, I want to, in a script, do an in-line replacement of a line in a file. Piece of cake in Linux with GNU sed. With OSX and BSD sed, not so much. I've been Googling, but nothing is really helping... either an answer is for a use case different enough from what I want to do, or it's something... (10 Replies)
my requirement is,
consider a file output
cat output
blah sdjfhjkd jsdfhjksdh
sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf
hellow there
this doesnt look good
et cetc etc
etcetera
i want to replace a line of line number 4 ("this doesnt look good") with some other line
... (3 Replies)
All, I appreciate any help you can offer here as this is well beyond my grasp of awk/sed...
I have an input file similar to:
&LOG
&LOG Part: "@DB/TC10000021855/--F"
&LOG
&LOG
&LOG Part: "@DB/TC10000021852/--F"
&LOG Cloning_Action: RETAIN
&LOG Part: "@DB/TCCP000010713/--A"
&LOG
&LOG... (5 Replies)
Sed command to replace a line in a file using line number from the output of a pipe.
Is it possible to replace a whole line piped from someother command into a file at paritcular line...
here is some basic execution flow..
the line number is 412
lineNo=412
Now i have a line... (1 Reply)
Hi all,
Let's say I have a script calling for the two variables PA_VALUE and PB_VALUE.
for pa in PA_VALUE
blah blah
do
for pb in PB_VALUE
blah blah
do
I have a text file with two columns of values for PA and PB.
14.5 16.7
7.8 9.5
5.6 3.6
etc etc
I would like to read this... (7 Replies)
Discussion started by: crimsonengineer
7 Replies
LEARN ABOUT PHP
xml_parse
XML_PARSE(3) 1 XML_PARSE(3)xml_parse - Start parsing an XML documentSYNOPSIS
int xml_parse (resource $parser, string $data, [bool $is_final = false])
DESCRIPTION xml_parse(3) parses an XML document. The handlers for the configured events are called as many times as necessary.
PARAMETERS
o $parser
- A reference to the XML parser to use.
o $data
- Chunk of data to parse. A document may be parsed piece-wise by calling xml_parse(3) several times with new data, as long as the
$is_final parameter is set and TRUE when the last data is parsed.
o $is_final
- If set and TRUE, $data is the last piece of data sent in this parse.
RETURN VALUES
Returns 1 on success or 0 on failure.
For unsuccessful parses, error information can be retrieved with xml_get_error_code(3), xml_error_string(3), xml_get_current_line_num-
ber(3), xml_get_current_column_number(3) and xml_get_current_byte_index(3).
Note
Entity errors are reported at the end of the data thus only if $is_final is set and TRUE.
PHP Documentation Group XML_PARSE(3)