10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Trying to use awk to remove a line only if $1 contains either ; or :. Thje awk below runs but no lines are removed. Thank you :).
awk
awk '$1 !~ /;/ || $1 !~ /:/ { print }' file
file
AARS2;TMEM151B 1
AASS 2
ABAT 3
ABCA1 3
ABCA10 1
ABCA12 2
ABCA13 1
ABCA13:AX746840 2
ABCA2 5 (5 Replies)
Discussion started by: cmccabe
5 Replies
2. Shell Programming and Scripting
In the following tab-delimited input, I am checking $7 for the keyword intronic. If that keyword is found then $2 is split by the . in each line and if the string after the digits or the +/- is >10, then that line is deleted. This will always be the case for intronic. If $7 is exonic then nothing... (10 Replies)
Discussion started by: cmccabe
10 Replies
3. UNIX for Dummies Questions & Answers
Hi all,
I've got a file that has 12 fields. I've merged 2 files and there will be some duplicates in the following:
FILE:
1. ABC, 12345, TEST1, BILLING, GV, 20/10/2012, C, 8, 100, AA, TT, 100
2. ABC, 12345, TEST1, BILLING, GV, 20/10/2012, C, 8, 100, AA, TT, (EMPTY)
3. CDC, 54321, TEST3,... (4 Replies)
Discussion started by: tugar
4 Replies
4. Shell Programming and Scripting
I am an awk beginner and need help figuring out how to search for a number in the first column and if it (or anything greater) exists, remove those lines.
AM11400012012 2.26 2.12 1.98 2.52 3.53 3.01 3.62 5.00 3.65 7.95 0.79 3.88 0.00
AM11400012013 3.39 2.29 ... (1 Reply)
Discussion started by: ncwxpanther
1 Replies
5. Shell Programming and Scripting
awk , sed Experts,
I want to remove first and last line after pattern match "vg" :
I am trying : # sed '1d;$d' works fine , but where the last line is not having vg entry it is deleting one line of data.
- So it should check for the pattern vg if present , then it should delete the line ,... (5 Replies)
Discussion started by: rveri
5 Replies
6. Shell Programming and Scripting
Hi,
I've this file:
1,
2,
3,
4,
5,
6,
I need to remove the line feed LF every 3 row.
1,2,3,
4,5,6,
Thanks in advance,
Alfredo (5 Replies)
Discussion started by: alfreale
5 Replies
7. Shell Programming and Scripting
Hi All,
How to remove col1 and last column in a line. Please suggest some awk stuffs.
Input
col1 col2 col3 col4
col1 col2 col3 col4 col5
col1 col2 col3 col4
col1 col2 col3
Output
Processing col2 col3 ...
Processing col2 col3 col4 ...
Processing col2 col3 ...
Processing... (5 Replies)
Discussion started by: k_manimuthu
5 Replies
8. Shell Programming and Scripting
Hi All,
I have a file containg lines along the likes of:
18:02:00 JOB02084722
18:09:00 2010120942
18:12:04 JOB02084723
18:34:16 20100709
etc.
What I want to do is remove the entire line when field 2 starts with a number so I'm left with:
18:02:00 JOB02084722
18:12:04... (8 Replies)
Discussion started by: Grueben
8 Replies
9. Shell Programming and Scripting
Hi, all
I have a file containing the following data:
name: PRODUCT_1
date: 2010-01-07
really_long_name: PRODUCT_ABCDEFG
I want to get the date (it is "2010-01-07" here), I could use the following code to do that:
awk... (6 Replies)
Discussion started by: kevintse
6 Replies
10. Shell Programming and Scripting
i have the long file more than one ns and www and mx in the line like .
i need the first ns record and first www and first mx from line .
the records are seperated with tthe ; i am try ing in awk scripting not getiing the solution.
... (4 Replies)
Discussion started by: kiranmosarla
4 Replies