Hi,
I have an awk code that reads an input file, checks the 4th column and tells if its fine.
My problem is that, I dont want to check the first 3 and last 3 lines.
This can be hard coded by using BEGIN and END in awk code.
But, I dont want to hardcode.
Could you please suggest, if I can go with FOR loop or something. if yes,how?
Per our forum rules, all threads must have a descriptive subject text. For example, do not post questions with subjects like "Help Me!", "Urgent!!" or "Doubt". Post subjects like "Execution Problems with Cron" or "Help with Backup Shell Script".
The reason for this is that nearly 95% of all visitors to this site come here because they are referred by a search engine. In order for future searches on your post (with answers) to work well, the subject field must be something useful and related to the problem!
In addition, current forum users who are kind enough to answer questions should be able to understand the essence of your query at first glance.
So, as a benefit and courtesy to current and future knowledge seekers, please be careful with your subject text. You might receive a forum infraction if you don't pay attention to this.
Thank you.
The UNIX and Linux Forums
---------- Post updated at 01:18 PM ---------- Previous update was at 01:15 PM ----------
Hi Radoulov,
thanks for responding.
Thing is that, The piece of codfe that you have provided produced syntax error,even though I could understand the logic behind your code.
After that, I tried to resolve it in many ways and tried with a while condition.
m posting my query again because, I could not get exactly from the error message, where i am going wrong.
else no one wud play and pass one's time with silly ping pongs.
OK,
just copy/paste here the command you execute and the exact error message
(I mean the code from the previous posts, not the one you modified)
so we don't have to guess.
In any case the standard suggestion applies: use nawk or /usr/xpg4/bin/awk if you're on Solaris.
The awk below does put in VUS in the 9th field but I can not seem to skip the header then add the VUS. I tried to incorporate NR >=2 and NR > 1 with no luck. Thank you :).
input
Chr Start End Ref Alt Func.refGene PopFreqMax CLINSIG Classification
chr1 43395635 ... (5 Replies)
I am trying to use awk skip each line with a ## or # and check each line after for STB= and if that value in greater than or = to 0.8, then at the end of line the text "STRAND BIAS" is written in else "GOOD".
So in the file of 4 entries attached.
awk tried:
awk NR > "##"' "#" -F"STB="... (6 Replies)
Hello,
I am new to AWK and in UNIX in general. I am hoping you can help me out here.
Here is my data:
root@ubuntu:~# cat circuits.list
WORD1
AA
BB
CC
DD
Active
ISP1
ISP NAME1
XX-XXXXXX1
WORD1
AA
BB
CC (9 Replies)
I need to amend the code blow such that it reads a "black list" before the "print" statement; if "substr($1,1,6)" is found in the "blacklist" it will ignore that record and continue. the code is from an awk script that is being called from shell script which passes the input values.
BEGIN { "date... (5 Replies)
Hello All,
I have a large file, more than 50,000 lines, and I want to split it in even 5000 records. Which I can do using
sed '1d;$d;' <filename> | awk 'NR%5000==1{x="F"++i;}{print > x}'Now I need to add one more condition that is not to break the file at 5000th record if the 5000th record... (20 Replies)
HI All,
I am trying to split a xml using awk. now the issue is i want to skip three lines from the xml file. first two and last one based on pattern. plz some one help. i am new to awk and struggling :wall:
<?xml version="1.0"?>
<notification>
.....
.....
.....
.....
........ (24 Replies)
Im trying to ssh to a remote machine to grep 'x info' *.log and Im able to get the grep output as expected but "after" the policies (1st 14 lines) - I need to skip the first 14 lines.
Its SunOS.
Plz help??? (7 Replies)
Im trying to ssh to a remote machine to grep 'x info' *.log and Im able to get the grep output as expected but "after" the policies (1st 14 lines) - I need to skip the first 14 lines.
Its SunOS.
Plz help??? (1 Reply)
Hello,
I'm trying to make a shell script to skip comments from an XML file, but with the code below only deletes comments that are in one line.
Can you tell me what can be added here?
nawk '
{
if($0 !~/<!--/) { a=0 }
if($0 ~/<!--/ && $0 ~/-->/) {a=1}
if($0 ~/<!--/) {a=1}
if... (1 Reply)
Guys....
Got a scenario in which I need to skip parsing the header record while I do an awk.
Does awk has the flexibility to accomplish this?.
If so, how do we do this?.
Thanks !!!
-Anduzzi :) (2 Replies)