Searching for lines in a file?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Searching for lines in a file?
# 8  
Old 04-29-2009
since 1 week ago, have you spent time reading up on awk?
# 9  
Old 04-29-2009
No sorry, been busy with my day job, only had a few minutes now to come back to it.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Grep -B used with -f? (Searching a file using a list of terms, output is lines before each match)

(1 Reply)
Discussion started by: Twinklefingers
1 Replies

2. Shell Programming and Scripting

Searching inverted lines

Hi fellas, I have a file like this: A_B B_D C_D D_B E_F G_H B_A F_E In other words, I have member1_member2 and member2_member1 in the same file. In the exemple aforementioned I have A_B and B_A, B_D and D_B, E_F and F_E. So, I would like to know a sript that print the lines B_A, D_B... (3 Replies)
Discussion started by: valente
3 Replies

3. Shell Programming and Scripting

searching a file with a specified text without using conventional file searching commands

without using conventional file searching commands like find etc, is it possible to locate a file if i just know that the file that i'm searching for contains a particular text like "Hello world" or something? (5 Replies)
Discussion started by: arindamlive
5 Replies

4. Shell Programming and Scripting

Searching for lines in textfiles

Hello all, I've a problem. I've two logfiles and i need to find lines in the second file by using information from the first file. First I need to extract a searchpattern from the first file. Its like abc=searchpattern&cde=. All between abc= and &cde= is the pattern I need to find in the second... (2 Replies)
Discussion started by: Avarion
2 Replies

5. Shell Programming and Scripting

Searching the lines within a range of time period in a text file

Dear All, Please advice me, I have a text file with one field date and time like below given. I need to find out the lines whchi content the time stamp between Wed May 26 11:03:11 2010 and Wed May 26 11:03:52 2010 both can be included, using awk command which could be an interactive so that I... (6 Replies)
Discussion started by: chinmayadalai
6 Replies

6. Shell Programming and Scripting

Searching patterns in 1 file and deleting all lines with those patterns in 2nd file

Hi Gurus, I have a file say for ex. file1 which has 3500 lines in it which are different account numbers and another file (file2) which has 230000 lines in it. I want to read all the lines in file1 and delete all those lines from file2 which has that same pattern as in file1. I am not quite... (4 Replies)
Discussion started by: toms
4 Replies

7. Shell Programming and Scripting

Searching for lines ending with }

I'm trying to search for lines ending with "}" with the following command but am not getting any output. grep '\}$' myFile.txt I actually want to negate this (i.e. lines not ending with "}"), but I guess that should be easier once I find the command that finds it? (11 Replies)
Discussion started by: BootComp
11 Replies

8. Shell Programming and Scripting

searching thru or combining multiple lines in a unix file

This is the problem actually: This regex: egrep "low debug.*\".*\"" $dbDir/alarmNotification.log is looking for data between the two quotation marks: ".*\" When I hate data like this: low debug 2009/3/9 8:30:20.47 ICSNotificationAlarm Prodics01ics0003 IC... (0 Replies)
Discussion started by: ndedhia1
0 Replies

9. Shell Programming and Scripting

lines searching >>

hi guys! I`ll really appreciate your help. The situation is: i have a log file, and i need to get the needed lines from it. linecount=$(cat -n http.log | grep ALERT | awk '{print $1}' | wc -l) lines=$(cat -n http.log | grep ALERT | awk '{print $1}') 1-string gets the number of found lines... (2 Replies)
Discussion started by: neverhood
2 Replies

10. Shell Programming and Scripting

sed searching across lines

hi, i'm making now a bash script, that runs some compiler... i want to take only errors form its output eg: output: bla bla bla ... erros is 1324546 the bla bla bla bla bla bla... ... and i want to get only erros is 1324546 the bla bla bla (11 Replies)
Discussion started by: miechu
11 Replies
Login or Register to Ask a Question