I'd strongly suggest you try your OWN implementation on a smaller sample and work out the 'kinks' yourself - it should be pretty simple given you already have a good start that you presumably understand.
Not trying it yourself will cost you knowledge in the long run.
Good luck and do come back if/when you get stuck.
The OP needs to reverse the original awk logic - the implementation is left as an exercise.
Hi vgersh99,
But, how do I feed the awk's output to sed? It is giving me the following error when I pipe to
and then I used -e and still it gives the same error.
---------- Post updated at 03:36 PM ---------- Previous update was at 03:24 PM ----------
Okay. Thanks for the suggestions.
I now understood what needs to be done.
So, what I did was this
But, there is a small glitch here. I am missing the immediate next line after the last line in intermediate_input.
Which means, instead of
I am seeing
Any thoughts?
Alos, please suggest a pointer to keep the input file and the final_input file's pattern or separators to be the same. They changed completely after running the above command.
What is the correct syntax to pipe or run three awk commands? Basically, using the output of the first awk as input in the second. Then using the output of the second awk in the third. Thank you :).
awk 'FNR==NR {E; next }$3 in E {print $3, $5}' panel_genes.txt RefSeqGene.txt > update.txt |... (3 Replies)
Sed command to replace a line in a file using line number from the output of a pipe.
Is it possible to replace a whole line piped from someother command into a file at paritcular line...
here is some basic execution flow..
the line number is 412
lineNo=412
Now i have a line... (1 Reply)
Hi,
I want to insert a value (x) in the 3rd position of each line in a file like below
a|b|c|d|1
a|b|c|d
a|b|c|d|e|1
a|b|cso that output file looks like
a|b|x|c|d|1
a|b|x|c|d
a|b|x|c|d|e|1
a|b|x|cI can do that using perl as below
#!/usr/bin/perl -w
use strict;
#inserting x at... (5 Replies)
I have file, i am extracting email address from file. but problem is that output is very ugly.
I am using this command
REMOVED "CSS OFFENDING CODE"...
While original filename have no such character. Please suggest. (20 Replies)
I want to delete all the blank lines from a file before a certain line number. e.g.
Input file (n: denotes line number)
1: a
2:
3: b
4: c
5:
6: d
I want to delete all blank lines before line number 3, such that my output is:
a
b
c
d
I see that sed '/^$/d' in_file works... (9 Replies)
Hi All. Thanks for your help in advance.
I have a requirement to examine the number of delimiters in each record of a file. If the record has the expected number of delimiters it should be passed into a 'good' file. If it does not, the record should be passed into a 'bad' file. I have been able... (8 Replies)
<tr><th align=right valign=top>Faulty_Part</th><td align=left valign=top>readhat version 6.0</td></tr> <tr><th align=right valign=top>Submit_Date</th><td align=left valign=top>2011-04-28 02:08:02</td></tr> .......(a long string)
I want to get all the field between "left valign=top>" and "... (2 Replies)
This script is supposed to find out if tomcat is running or not.
#!/bin/sh
if netstat -a | grep `grep ${1}: /tomcat/bases | awk -F: '{print $3}'` > /dev/null
then
echo Tomcat for $1 running
else
echo Tomcat for $1 NOT running
fi
the /tomcat/bases is a file that... (2 Replies)
Is there a way I can do this:
search for text and replace line containing matched text with a different line?
For example:
"I want to replace text"
I want to search for replace and then change the line to
I am perplexed.
Hope that makes sense.
Thanks in advance. (4 Replies)