Thnx Guyz,
The above code also worked as expected.
Now, I want this value in between the tags to be captured in a variable.
I want to search my file for number of occurances for this value.
Eg.
If i have the following lines in my file:
Quote:
<ABC>hello</ABC><XYZ>I want This</XYZ><CDF>World</CDF>
<ABC>Vzup</ABC><XYZ>This data is Needful</XYZ><CDF>Moon</CDF>
<ABC>hello</ABC><XYZ>I want This</XYZ><CDF>World</CDF>
<ABC>hello</ABC><XYZ>I want This</XYZ><CDF>World</CDF>
<ABC>Vzup</ABC><XYZ>This data is Needful</XYZ><CDF>Moon</CDF>
<ABC>Vzup</ABC><XYZ>Search further</XYZ><CDF>Moon</CDF>
I want to count the number of occurances for each of these values inside tag <XYZ>
Ths, i want to capture this value in a variable.
So, i can further use the value of this variable in
I tried it but i am able to get this value in a file and not a variable.
Hi All,
i want to write a shell script read below file line by line and want to exclude the lines which contains empty value for MOUNTPOINT field.
i am using centos 7 Operating system.
want to read below file.
# cat /tmp/d5
NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root"... (4 Replies)
Hi all,
I'm new to scripting.. facing some problems while inserting content of a file into another file...
I want to insert content of a file (file2) into file1, before first occurrence of "line starts with pattern" in file1
file1
======
working on linux
its unix world
working on... (14 Replies)
I am trying to combine lines with these conditions:
1. First line starts with text of "libname VALUE db2 datasrc" where VALUE can be any text.
2. If condition1 is met then continue to combine lines through a line that ends with a semicolon.
3. Ignore case when matching patterns and remove any... (5 Replies)
Hi,
I have got the below requirement. please suggest.
I have a file like,
Processing Item is:
/data/ing/cfg2/abc.txt
/data/ing/cfg3/bgc.txt
Processing Item is:
/data/cmd/for2/ght.txt
/data/kernal/config.klgt.txt
I want to process the above file to get the output file like,
... (5 Replies)
Hello there, I am new to unix and would like to do the following, hoping someone would give some guide, thanks in advance.
Lets say i have a file like this:
A w x y w x 0.1
B w x y w x 0.3
C w x y w x 0.7
D w x y w x 0.9
E w x y w x 0.2
So i would like to extract line 1 data where line... (2 Replies)
Hi All,
Please can someone assist in the script I have made that searches a pattern in a file and delete the whole line containing the pattern.
#!bin/sh
# The pattern that user want to add to the files
echo "Enter the pattern of the redirect"
read value
# check if the user has... (1 Reply)
I have a file that will sometimes contain a pattern. The pattern is this:
FRM CHK 0000
I want to find any lines with this pattern, delete those lines, and also delete the line above and the line below. (4 Replies)
I have a file that will sometimes contain a pattern. The pattern is this:
W/D FRM CHK 00
I want to find any lines with this pattern, delete those lines, and also delete the line above and the line below. (1 Reply)
Hi,
I have a file called /bb/bin/rstrt.
I need to move the line/entry "ccpm_load_shared_memory" after the entry
"initcorp". The problem is that there are several entries for "initcorp" in this file and I need the entry to be moved only after the first instance of "initcorp"
Is there a way... (5 Replies)