ripat, your script will work fine but the problem is sometimes
I get only open or close within the begin and end script.
era,
Your script works beautifully. I just need one request if you dont mind.
begin and end is something I will add later. What if I dont want to add "end" and only "begin". Now I have to use the "begin" and the "begin" of the next section as an end.
When count=0 and begin is the next begin then display.
I want to check for the exact "begin" so
it will only look for "begin" and not "beginning" or "prebegin",
just like what you said.
Double quotes have no significance in regular expressions, you are looking for literal double quotes around the begin, which obviously won't be there.
However, you can check for equality: if field $1 is exactly equal to "begin" then it's a match. And if you have some data you have remembered from a previous section, print that and flush the state variables before starting over.
The last line copes with the case when at end of file there is no new "begin" line but you have something you want to print from the previous "begin" section.
Experts,
Need your support for this awk script.
we have only one input file, all these column 1 and column 2 are in same file and have to do lookup for values in one file(column1 and column2) but output we need in another file
Need to grep row whose string contains 9K from column 1. When found... (6 Replies)
I have 3 files. Each of those files have the same number of records, however certain records have different values. I would like to grep the field in ALL 3 files and display the output with only the differences in column wise and if possible line number
File1
Name = Joe
Age = 33... (3 Replies)
I want to search a small string in a large string and find the locations of the string. For this I used grep "string" -ob <file name where the large string is stored>. Now this gives me the locations of that string. Now how do I store these locations in a text file.
Please use CODE tags as... (7 Replies)
Hi,
Need your help for this scripting issue I have. I am not really good at this, so seeking your help.
I have a file looking similar to this:
Hello, i am human and name=ABCD.
How are you?
Hello, i am human and name=PQRS.
I am good.
Hello, i am human and name=ABCD.
Good bye.
Hello, i... (12 Replies)
I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios.
Cat test
Nov 10, 2012 5:17:53 AM
INFO: Request Type
Line 1.... (5 Replies)
I'm getting the input row in this format it contains 2 alphabets followed by numbers between 1 and 7 and again 2 alphabets followed by numbers between 1 and 7.
Now I need to parse this input into several output rows in this format 2 alphabets followed by each number occurrence
suppose... (5 Replies)
Hello Gurus,
Apologies if this Q has been repeated but i was not able to find it :(
I have an input file:
-------------------------------
Replace DB.Employee
as
select
column1
column2
from DB_T.Emp
and DB.Test
and
DB.Dept
and
DB_T.Ter;
------------------------ (4 Replies)
Hi,
I have a file that looks like this (tab seperated):
Barry -3 -4 -5 -10 -4 6 -8 20 -6 NaN NaN NaN
Brend -2 4 -3 -7 -3 8 -9 -10 -6 NaN NaN NaN NaN NaN
Harry -10 -9 -40 6 -7 3 -7 -2 -5 NaN NaN NaN NaN NaN NaN NaN
I want to print the first column... (4 Replies)
Hey guys,
I have this file generated by me... i want to create some HTML output from it.
The problem is that i am really confused about how do I go about reading the file.
The file is in the following format:
TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
In my script I read a input file and search all the files in a directory and it's sub-directories for that string using:
find . -type f -print | xargs grep $var1
This just displays all the lines the string was found on. Too much data.
What I need is to store in a file one time those... (17 Replies)