Grep table entry problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Grep table entry problem
# 1  
Old 03-27-2008
MySQL Grep table entry problem

Hi,

I have a table which looks like this

Line a b c
0 10 0 0
1 0 0
2 0 0 0
3 0 0 0
4 0 0 0
5 0 0 0
6 0 0 0
7 0 0 0
8 0 0 0
42 4614 63 0.013470
111 2765 42 0.014963
112 2748 42 0.015054
226 4118 42 0.010096
227 4118 42 0.010096
228 4118 42 0.010096

When i do a query on grep -w 42; it returns me

42 4614 63 0.013470
111 2765 42 0.014963
112 2748 42 0.015054
226 4118 42 0.010096
227 4118 42 0.010096
228 4118 42 0.010096

while I am only concern on
42 4614 63 0.013470

I tried to have grep -w 42$ but it returns nothing.

Please advise. Thanks.
# 2  
Old 03-27-2008
Code:
grep "^42" file

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to grep for first entry in a file?

Hello friends, I have a question. Sometimes I have to search for an entry in a file that is repeated thousands of times. Can you tell me how to search so that i get limited results? For example: file: myfile.txt grep "hello world" myfile.txt this above grep will generate 5000... (4 Replies)
Discussion started by: DallasT
4 Replies

2. Shell Programming and Scripting

Need to grep certain entry out of log file

This one is a bit too challenging for me... Hopefully you guys can help. Let's say I have a log file called: "$MW_HOME/user_projects/domains/IDMDomain/servers/wls_ods?/logs/wls_ods1-diagnostic.log" In this log file I want to search for "DIP-10219". When I execute this $ cat... (7 Replies)
Discussion started by: exm
7 Replies

3. Shell Programming and Scripting

[awk] grep a part of filename as entry file

hi all, i need to combine these files into one csv file. Bounce_Mail_Event_Daily_Report_01_Jul_2012.csv Bounce_Mail_Event_Daily_Report_02_Jul_2012.csv Bounce_Mail_Event_Daily_Report_03_Jul_2012.csv Bounce_Mail_Event_Daily_Report_04_Jul_2012.csv... (10 Replies)
Discussion started by: makan
10 Replies

4. Shell Programming and Scripting

Problem with crontab entry

Hi, I have a shell script which needs to be run at 5 am everyday.I have crontab entry as "0 5 * * 0-6 /wfsdev1/app/edw/bin/HealthCh.sh" but this job is not running at scheduled time.What can be the possible reasons for this? Thanks, Anil (5 Replies)
Discussion started by: anil029
5 Replies

5. UNIX for Dummies Questions & Answers

grep first occurrence but continue to next entry in patternfile

I have 1300 files (SearchFiles0001.txt, SearchFiles0002.txt, etc.) , each with 650,000 lines, tab-delimited data. I have a pattern file, with about 1000 lines with a single word. Each single word is found in the 1300 files once. If I grep -f PatternFile.txt SearchFiles*.txt >OutputFile.txt... (2 Replies)
Discussion started by: newhavendweeb
2 Replies

6. UNIX Desktop Questions & Answers

How to grep for password file entry

How would I grep for password file entry without using grep 'username' /etc/passwd? perhaps with who? I want to create alias that will find the password file entry regardless of the user who is using it. Thanks (4 Replies)
Discussion started by: alis
4 Replies

7. UNIX for Dummies Questions & Answers

grep for password file entry

How would I grep for password file entry without using grep 'username' /etc/passwd? perhaps with who? I want to create alias that will find the password file entry regardless of the user who is using it. I am trying to get the same exact line from the file entry like: Name : Password : UserID... (7 Replies)
Discussion started by: alis
7 Replies

8. Solaris

how do i make a route entry permanent in the routing table on solaris 8?

how do I make sure that the entry in the routing table on Solaris 8 stay permanent after rebooting the server. For example route add 172.20.1.60 -netmask 255.255.255.0 172.20.255.253 Each time the server reboots the entry disappears when using the command netstat -nr (2 Replies)
Discussion started by: tv.praveenkumar
2 Replies

9. Fedora

Regaring File Table entry

Hi, I have written following code & ran it on Fedora Linux. Before executing it I have created a.txt (touch a.txt). #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> #include <fcntl.h> int main() { int fd1, rc; fd1 = open("a.txt",... (3 Replies)
Discussion started by: darshan.ghumare
3 Replies

10. Solaris

etc host entry problem

Dear Members, My app server is running in sun solaris. When i am trying to invoke another application running in a different m/c by calling its ip aa.bb.cc.dd , i am succeeding. But, when i maintain the same ip in etc host and try to invoke the application using the host name, it is failing.... (5 Replies)
Discussion started by: kandanathan
5 Replies
Login or Register to Ask a Question