Hello Mr Don Thanks for this useful code. But could you please help me with some doubts.
1. Is "copy" variable, Part of block (2) ?, which will have a value 1 .That will print as default.
In awk, the blocks you are talking about have the format:
and as you know if the { action } part is missing, it defaults to:
So, the line:
is a block of its own that could be rewritten as:
(since print with no arguments defaults to print $0). When the variable copy is set to a non-zero, non-empty value, that line causes the current line to be printed. And when copy is an empty string (the default value until it is set to something else) or zero that block is a no-op.
Quote:
2. What is the purpose of block (3) . As no print statement or default 1 is present.
Block (3) turns off copying input lines to the output after the end of a set of <JOB> tags:
has been conditionally printed.
Quote:
3.Which part of code is printing other lines like <VARIABLE....<INCOND......
Thanks,
The line in the code:
prints everything this script prints except the opening <FOLDER...> tag line that is printed in block (2) the 1st time a job is found that is to be printed in that folder and the </FOLDER> line that is printed in block (4) iff one or more jobs were found to be printed in the preceding folder.
This User Gave Thanks to Don Cragun For This Post:
Hi All,
I have been working on something that doesn't seem to have a clear regex solution and I just wanted to run it by everyone to see if I could get some insight into the method of solving this problem.
I have a flat text file that contains billing records for users, however the records... (5 Replies)
111111111100000000001111111111
123232323200000010001114545454
232435424200000000001232131212
342354234301000000002323423443
232435424200000000001232131212
2390898994200000000001238908092
This is the record format.
From 11th position to 20th position in a record there are 0's occuring,and... (6 Replies)
Hi Gents,
I have a file 1 like this
1 1000 20
2 2000 30
3 1000 40
5 1000 50
And I have other file 1 like
2 1
I would like to get from the file 1 the complete line which are in file 2, the key to compare is the column 2 then output should be.
2 2000 30.
I was trying to get it... (5 Replies)
Hi
I have xml file with multiple records and would like to extract records from xml with specific condition if specific tag is present extract entire row otherwise skip .
<logentry revision="21510">
<author>mantest</author>
<date>2015-02-27</date>
<QC_ID>334566</QC_ID>... (12 Replies)
Hello everybody,
I have a double mission with some XML files, which is pretty challenging for my actual beginner UNIX knowledge. I need to extract some strings from multiple XML files and create a new XML file with the searched strings..
The original XML files contain the source code for... (12 Replies)
Hi
I have two lists of patterns named A and B consisting of around 200 entries in each and I want to extract all the sentences from a big text file which match atleast one pattern from both A and B.
For example, pattern list A consists of :
ama
ani
ahum
mari
...
...
and pattern... (1 Reply)
awk 'NR==FNR{arr;next} $0 in arr' /tmp/Data_mismatch.sh /prd/HK/ACCTCARD_20160115.txt
edit by bakunin: seems that one CODE-tag got lost somewhere. i corrected that, but please check your posts more carefully. Thank you. (5 Replies)
more data.txt
i need this exacted from data.txt
This is the command i tried
sed -n "/Start_of_DISK_info:\/u/,/End_of_DISK_info:\/u/p" data.txtBut, unfortunately it does not do an exact match. Instead, it prints text between both these strings /u & /u/tmp like below.
i need this... (6 Replies)
Hi everyone,
So i'm struggling with an xml (log file) where we get information about some devices, so the logfile is filled with multiple "blocks" like that.
Based on the <devId> i want to extract this part of the xml file. If possible I want it to have an script for this, cause we'll use... (5 Replies)