Hi everyone,
I have managed to extract the xml data i need from a text file by using the command below. The xml data extracted has the following form:
(el3 element is optional, and el1 and el2 may have white spaces)
There are two problems with this code. The first one is that if the elements have white space the echo outputs (reads until white space) :
<El1>My
The second problem is how should i deal with the optionality of el3.
If the line is read every time, and the element el3 is not present , the following Title element is considered as el3.
Thanks in advance
---------- Post updated at 12:22 PM ---------- Previous update was at 11:08 AM ----------
I have managed to solve the first problem, instead of read output , i read line. Now i just want to do the following , when i read a line that does not match a specific pattern , i would like to return the cursor to it's initial position , one line up. For example:
I also tried using continue in the if block but it does not work properly
Please advise
Last edited by Franklin52; 12-16-2009 at 06:29 AM..
Reason: Please use code tags
I manage to get this xml through the following command :
And inside the while read line :
If the el3 is missing in the xml document as it is optional , the third read line , will read the next <Title> element, and will move the cursor one line down , which is not desirable . What i want to achieve inside this block :
is to move the read cursor one line up , so as to re-read the <Title> element in the next loop. Also i cannot use goto.
Hi all,
i developed a script to measure the uptime of a process in a Solaris 10/11 environments.
All is well, but i came across a situation where there are multiple processes of the same name. Basically i have the following result file:
beVWARS 13357 19592122
beVWARS 14329 19591910... (4 Replies)
Hi,
I have a text like these:
ECHO "BEGGINING THE SHELL....."
MV FILE1 > FILE2
UNIQ_ID=${1}
PARTITION_1=`${PL}/Q${CON}.KSH "SELECT ....."
PARTITION_2=`${PL}/Q${CON}.KSH "SELECT ........"
${PL}/Q${CON}.KSH "CREATE ...."
IF ....
.......
I would like to extract only text that only... (4 Replies)
set fid
set content
close $fid
## Split into records on newlines
set records
send "records splited\n"
send $records\n
set a "test\n"
send $a
foreach rec $records {
## Split into fields on colons
set fields
#set fields
puts $fields
for {set x 1} {$x < 4} {incr x} {... (1 Reply)
Dear community, I know, this is very stupid question, but I'm scratching my head to find a solution.
I have a variable like this:
var=" INFO : ABCDEFG"Now I need to remove the leading spaces and output the result like:
echo "FIELD1 ; FIELD2 ; $RESULT ; FIELD4"
... (17 Replies)
Hi I have something like this:
EXAMPLE 1
CREATE UNIQUE INDEX "STRING_1"."STRING_2" ON "BOSNI_CAB_EVENTO"
("CD_EVENTO" , "CD_EJECUCION" ) PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 5242880 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "DB1000_INDICES_512K"... (4 Replies)
I have been reading several posts regarding how to extract text from a file, but none of those have helped me for what I need.
This is my problem: I need to extract the text after my pattern
So my line is:
485.74 6589.5 Log likelihood: 1485.79
My pattern is 'Log likelihood:'
and I need... (2 Replies)
Hi all,
my problem is extract a value from a text, i mean, I have this text:
> ala
Nr of active alarms are: 16
================================================================================================
Sever Specific Problem Cause Mo-Reference... (15 Replies)
I executed a following sed command
=> echo "a/b/c/d/e/f/g/h" | sed 's/\/*$//g'
a/b/c/d/e/f/g
Now what if I want to extract "g" from "a/b/c/d/e/f/g/h" . That is second last string using SED. (4 Replies)
needa c program to extract text between two delimiters from some text file.
and then storing them in to diffrent variables ?
text file like 0:
abc.txt
=========
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass... (7 Replies)