I have a .xml file that looks something like this :
I want to extract only the 'chunk of file' from '<measInfo>' to '</measInfo>' containing string1 (or a certain string that I choose, so the extraction command should contain a variabe for the string. I'm not very good in awk.. so I need your help.
Well.. it's not really relevant from my point of view. I tried a combination of grep -n (to obtain line number) and cascade of head | tail commands .. which delivers the result, but I need it all to be done in awk.
Now.. from awk all I tried was
And this gives me all the chunks from <measInfo> to </measInfo> from the target file. But I need to keep only the chucnk that contains the string I look for.. any idea how to keep each chunk in a variable and then to search each variable at a time for my string.. sort of a looping thing.
I know it can be done with awk.. but I don;t have the chops for it
One more question..
I tried to use the awk snippet replacing <string1> with a variable and it didn;t work:
I replaced single quotes with double quotes and added "\" before other double quotes inside the snippet.
But it doesn;t work. Id doesn't give me a syntax error but doesn;t return nothing.
I think the variable substitution is not done..
Any idea how can I accomplis this or what am I doing wrong ?
Hi
I have two text files. The first file is TEXTFILEONE.txt as given below:
<Text Text_ID="10155645315851111_10155645333076543" From="460350337461111" Created="2011-03-16T17:05:37+0000" use_count="123">This is the first text</Text>
<Text Text_ID="10155645315851111_10155645317023456"... (7 Replies)
Hi,
I have a log file (log.txt) that which contains lines of date/time.
I need to create a script to extract a CSV file (out.csv) that gets all the sequential times (with only 1 minute difference) together by stating the start time and end time of this period.
Sample log file (log.txt)
... (7 Replies)
Hi All,
I have a file which is like this:
rows.dat
1 2 3 4 5 6
3 4 5 6 7 8
7 8 9 0 4 3
2 3 4 5 6 7
1 2 3 4 5 6
I have another file with numbers like these (numbers.txt):
1
3
4
5
I want to read numbers.txt file line by line. The extract the row from rows.dat based on the... (3 Replies)
Hi to all,
I got this content/pattern from file http.log.20110808.gz
mail1 httpd: Account Notice: close igchung@abc.com 2011/8/7 7:37:36 0:00:03 0 0 1
mail1 httpd: Account Information: login sastria9@abc.com proxy sid=gFp4DLm5HnU
mail1 httpd: Account Notice: close sastria9@abc.com... (16 Replies)
Upon replacing my linux router/server with a Solaris one I've noticed very poor network performance. The server itself has no issues connecting to the net, but clients using the server as a router are getting a lot of IP fragments as indicated from some packet sniffing I conducted.
Here was my... (3 Replies)
For some reason ipfilter is blocking inbound fragmented ip packets (the packets are larger than the interface's MTU) that are encapsulating UDP segments. The connection works, so I know ipfilter is letting some traffic through, it is just a lot slower than it should be.
Rules that allow the... (3 Replies)
When discussing inodes and data blocks, I know Solaris creates these data blocks with a total size of 8192b, divided into eight 1024b "fragments." It stores data in "contiguous" fragments and solaris doesn't allow a file to use portions of two different fragments. If the file size permits, then the... (4 Replies)