awk to retain header lines in output


Login or Register to Reply

 
Thread Tools Search this Thread
# 8  
Old 3 Weeks Ago
I am sorry but i dont understand, can you pleasecomment the awk if possible? Why are only the last two lines checked/compared? Thank you Smilie.
# 9  
Old 3 Weeks Ago
Hi cmccabe,
If you take as a field separator [\t;], then the lines will be separated in different ways
fifth string:
chr1 11174383 COSM1161896 A G 264.674 PASS AF=0
seventh string:
chr1 43814978 COSM1342796;COSM86963 A G 231.262 PASS AF=0.05
And the first parameter for comparison (AF=0) will be located in different fields. In the first case, in field 8, and in the second, in field 9
due to the fact that in the last line there appears an additional separator (;) marked in red.
With the second parameter for comparison is similar
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Print header and lines that meet both conditions in awk cmccabe Shell Programming and Scripting 0 08-23-2017 09:13 AM
awk to add lines with symbol to output file cmccabe Shell Programming and Scripting 5 06-26-2017 03:16 PM
Remove lines from output in files using awk cmccabe Shell Programming and Scripting 4 07-01-2016 01:19 PM
awk to output lines less than number cmccabe Shell Programming and Scripting 3 07-30-2015 01:18 PM
Manipulate all rows except header, but header should be output as well juzz4fun Shell Programming and Scripting 2 05-10-2013 10:42 AM
AWK print and retain original format chrisjorg Shell Programming and Scripting 7 03-29-2012 04:46 AM
cat to a file but retain header Grueben UNIX for Dummies Questions & Answers 4 03-09-2012 12:22 AM
awk file comparison, x lines after matching as output killerbee Shell Programming and Scripting 5 01-22-2012 07:04 AM
How to retain blank spaces in AWK? bsn2011 Shell Programming and Scripting 8 02-06-2011 09:01 PM
Print duplicate only lines as normal output - Awk quincyjones Shell Programming and Scripting 2 09-30-2010 03:29 AM
Need to extract some lines from output via AWK asirohi Shell Programming and Scripting 3 06-10-2010 04:31 AM
AWK: Backslash \ and forcing output not to go onto new lines ingli UNIX for Dummies Questions & Answers 4 02-05-2010 03:48 PM
How to retain the header information of a file ahjiefreak UNIX for Dummies Questions & Answers 0 12-04-2007 06:21 PM
Strip 3 header lines and 4 trailer lines ganesh123 Shell Programming and Scripting 9 03-10-2007 04:15 PM