That work great! You also reminded me about escaping the parenthesis and ;. I changed the CH regex because I need to catch single and possibly double digits.
Howdy Folks,
I have a list that looks like this:
(file2.txt)
AAA
BBB
CCC
DDD
and there are 24 of these short words.
I am matching these patterns to another file with 755795 lines (file1.txt).
I have this code for matching:
awk -v f2=file2.txt '
BEGIN {
while(... (2 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)
Hi Experts,
I have a data with multiple entry , I want to filter PKG= & the last column "00060110" or "00088150" in the output
file:
###############################################################################################
PKG= P8SDB :: VGS = vgP8SOra vgP8SDB1 vgP8S001... (5 Replies)
Is there a simple way to use awk to match multiple lines?? Somehow using \n isn't working for me. Ultimately I'm trying to insert "WWW" 3 lines above "eee".
input
aaa
bbb
ccc
ddd
eee
fff
output
aaa
bbb
WWW
ccc
ddd
eee (1 Reply)
Hello.
grep v2.21
Debian 8
I wish to search for and output these patterns in order;
"From " "To: " "Subject: " "Message-Id: " "Date: " "To: "
grep works, but not in strict order...
$ grep -a -E "^From |^Subject:|^From: |^Message-Id: |^Date: |^To: " InboxResult;
From - Wed Feb 18... (10 Replies)
GM,
I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed.
I am assuming that sed, awk or even perl could do what I need.
I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
I am trying to look for $2 of file1 (skipping the header) in $2 of file2 (skipping the header) and if they match and the value in $10 is > 30 and $11 is > 49, then print the line from file1 to a output file. If no match is foung the line is not printed. Both the input and output are tab-delimited.... (3 Replies)
I am trying to create a cronjob that will run on startup that will look at a list.txt file to see if there is a later version of a database using database.txt as the source. The matching lines are written to output.
$1 in database.txt will be in list.txt as a partial match. $2 of database.txt... (2 Replies)
In the awk below I am trying to output those lines that Match between file1 and file2, those Missing in file1, and those missing in file2. Using each $1,$2,$4,$5 value as a key to match on, that is if those 4 fields are found in both files the match, but if those 4 fields are not found then missing... (0 Replies)