02-14-2009
Quote:
Originally Posted by
kaixinsjtu
totally pis*ed off.
I have a data set (xxx.txt), as follows:
chr1 3821 rs127372 A/C 0.823
chr1 3822 rs127376 A/C/G 0.899
chr1 3722 rs612634 A/C 9.22
chr1 3262 rs7152 A/T 0.22
chr1 3711 rs737 A/C/G 0.2323
.......
I only want to get those lines with "A/C" (Exact match only!!)
therefore, I use:
grep -w A/C xxx.txt
however, the results really bother me! not only 'A/C', but also those lines with "A/C/G" or 'A/C/*' appear in my new file.
I don't know what's wrong with that. 'grep' used to work well for me.
Anyone knows?? thanks!!
How about
grep "A/C " xxx.txt
? there is a space after "C"
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm using the case statement in the following script and it always takes the "*" default choice while it should be "3".
I wonder why ???
dt_auj=`date +%d`
NBLOG=`ls -al /users/notes01/LOG/t*|awk '{print $7}'|grep $dt_auj|wc -l`
case $NBLOG in
1) cat ~/LOG/console-notes > $fic_tmp1 ;;
2)... (5 Replies)
Discussion started by: Nicol
5 Replies
2. UNIX for Dummies Questions & Answers
253 lab2-36:~/try_direct/another> set x=1;set y=2;@z=$x+$y
@z=1+2: Command not found.
254 lab2-36:~/try_direct/another> (11 Replies)
Discussion started by: endeavour1985
11 Replies
3. Linux
How can I configure it?
I have a swedish keyboard with swedish keyboard setting. Everything works perfectly (едц) except that button. What can be wrong?
/Richard
++
NOTE: It seems like the computer notices the input but that the button isn't assigned to anything (the keyboard-cursor stops).... (1 Reply)
Discussion started by: riwa
1 Replies
4. UNIX for Advanced & Expert Users
when i give "ps -elf" or "ps" system gets hung.
if i press "^c" come out from it...
pls help..what should i do to get it resolved.
thanks
CKanth (4 Replies)
Discussion started by: srikanthus2002
4 Replies
5. UNIX for Dummies Questions & Answers
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
6. AIX
When I use "/" to look for a particular command that I typed in the current session it says
D02:-/home/user1/temp> /job
ksh: /job: not found.
D02:-/home/user1/temp>
previously it used to fetch all the commands which had job in it..
for example subjob, endjob, joblist etc...
may I... (7 Replies)
Discussion started by: meetzap
7 Replies
7. AIX
More issues. The "|" key doesn't work at all, either in the text terminal or in mwm (which starts fine when I do "startx").
How am I supposed to troubleshoot without a "|" key? (2 Replies)
Discussion started by: smithfarm
2 Replies
8. Shell Programming and Scripting
Working with IP addresses is a pain...
Here's my problem: I'm putting some interface information to a file:
3.185.201.2 | Tu1102
152.162.54.130 | Gi0/2.36
3.185.226.2 | Gi0/1
3.185.0.82 | Tu1
... (12 Replies)
Discussion started by: turk22
12 Replies
9. Shell Programming and Scripting
Hello, :)
I've an issue with the creation of a directory, All work without it :mad: So, below, my scripts with the debug output :
#!/bin/bash
# PATHS
HOME_BACKUP="/home/backup"
HOME_SCRIPT="/home/scripts/test/backup_server"
TARGET="/var/www"
# DATE
DATE_Ymd=$(date +%Y-%m-%d)
#... (1 Reply)
Discussion started by: Arnaudh78
1 Replies
ZGREP(1) General Commands Manual ZGREP(1)
NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)
ZGREP(1)