means. I have no idea why you would want to run two seemingly identical awk programs instead of using A == 1 as a condition for the single action (named content in your pseudo-code) in both of your awk scripts.
You said that you're writing a file and let the next awk use something unspecified as a variable, but your code doesn't show that any variables or files are being passed to either of the awk scripts in your pseudo-code.
If there is something in the code I suggested that you don't understand, I'll be happy to try to answer specific questions. If you're just saying that my code is too complex and you don't want to try to understand what it is doing, I'm sorry that I have wasted your time and mine trying to help you.
sorry for poor english , i'm din't mean that your code is complex and i'm dont want to understand, it very great explanation for your code.
the question i'm asking is difference question regrading the question i'm asking previously, but i'm don't want open another topic , scare it become spam topic.
The question is i'm try pass any information to another awk code, since too much condition, im still on learning status , i'm not well to handle with it , so currently i'm doing is split it to multiple awk , and create file and read the file content as variable.
so i'm asking is that any method for 2 awk share same variable, instate of create new file as a variable.
below is a part from my script.
i have 2 type of condition.
1. if temp.rpt is empty then it will empty the content for board_temp (by using print "" >board_temp, so with this step will making the next awk "look like skip" , and go to 3rd awk.
2. if temp.rpt have content then proceed with next awk.
Moderator's Comments:
Seriously: Please use CODE tags as required by forum rules!
Last edited by RudiC; 12-14-2017 at 05:10 AM..
Reason: Added CODE tags.
Hi I need to add a comment line at the begining of a text file. The scenario is given below.
1. The number of servers that needs to be updated is around 80
2. The location of the text file in all the servers are the same including the file name.
3. The comment has to be added at the very... (2 Replies)
Hello Experts,
I am newbie to perl, just curious to know how to do the following in perl.
suppose I ve a txt file like below. when it founds "*Main Start"
Then go to "*Main End,,,,,,,," patteren and just collect the number from the previous line of "*Main End,,,,,,," pattern . In my... (17 Replies)
I need a good one-liner to look in a specific text file for a line of text and if it's not found, add it at the bottom of the file.
Perl, sed, not particular, whatever works. To make matters worse, the line of text is in a config script with lots of special characters and needs lots of... (3 Replies)
Help with script that will check log, then find a match is found, add that as the subject line.
1. The script will always run as a deamon.. and scan the event.log file
2. when a new 101 line is added to the event.log file, have the script check position 5,6 and 7 which is the job name, which... (2 Replies)
Hi,
i need some help. i am not sure about my idea.
I have a script directory under my home directory,which has a lot of scripts in it.
These are some names of the scripts in /axxhome/prdv/script
aly300.sh
axt300.sh
arv300.sh
clp300.sh
ctth300.sh
aly400.sh
axt400.sh
arv400.sh... (6 Replies)
Hello, can someone help me how to find a word and 2 lines after it and then send the output to another file.
For example, here is myfile1.txt. I want to search for "Error" and 2 lines below it and send it to myfile2.txt
I tried with grep -A but it's not supported on my system.
I tried with awk,... (4 Replies)
I have a file like this
DoctorName
Address1
Address2
DOB
InsuredName
Address1
Address2
DOB
PatientName
Address1
Address2
DOB
ClaimNo1
DoctorName
Address1
Address2
DOB
InsuredName (2 Replies)
Hi All,
From the below line if we want to display all the text till found pattern dot/. I was trying with the below code but couldn't able
to print text before the pattern. it display texts which is found after pattern.
awk '/assed/{print;getline;print}' file_name | sed 's/^*. *//'
input... (4 Replies)
Hello Everyone,
I have a file with 5 fields in each line just like mentioned below. Also the 4th field is time elapsed(hh:mm:ss) since the process is running
xyz abc status 23:00:00 idle
abc def status 24:00:00 idle
def gji status 27:00:02 idle
fgh gty status 00:00:00 idle
Here I... (8 Replies)
Looking for help,
i have input file like below and want to modify to expected output, if can without create additional file, hope can direct modify it.
have 2 thing need do.
1st
is adding a word (testplan generation off) after ! ! IPG: Tue Aug 07 14:31:17 2018
2nd
is adding... (16 Replies)