finding pattern without grep in unix


 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions finding pattern without grep in unix
# 1  
Old 05-01-2011
finding pattern without grep in unix

how can i find related pattern in a text file without using grep command in unix
# 2  
Old 05-01-2011
You can for example use sed and awk (or nawk if on solaris)
# 3  
Old 05-01-2011
you may use Perl or Python as well
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[sed] Finding and sticking the pattern to the beginning of successive lines up to the next pattern

I have a file like below. 2018.07.01, Sunday 09:27 some text 123456789 0 21 0.06 0.07 0.00 2018.07.02, Monday 09:31 some text 123456789 1 41 0.26 0.32 0.00 09:39 some text 456789012 1 0.07 0.09 0.09 09:45 some text 932469494 1 55 0.29 0.36 0.00 16:49 some text 123456789 0 48 0.12 0.15 0.00... (9 Replies)
Discussion started by: father_7
9 Replies

2. UNIX for Dummies Questions & Answers

Grep -v lines starting with pattern 1 and not matching pattern 2

Hi all! Thanks for taking the time to view this! I want to grep out all lines of a file that starts with pattern 1 but also does not match with the second pattern. Example: Drink a soda Eat a banana Eat multiple bananas Drink an apple juice Eat an apple Eat multiple apples I... (8 Replies)
Discussion started by: demmel
8 Replies

3. Shell Programming and Scripting

sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3

Hi , I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows. # diff mir_lex.c.modified mir_lex.c.orig 3209c3209 < if(yy_current_buffer -> yy_is_our_buffer == 0) { --- >... (5 Replies)
Discussion started by: breezevinay
5 Replies

4. Shell Programming and Scripting

Finding the pattern and replacing the pattern inside the file

i have little challenge, help me out.i have a file where i have a value declared and and i have to replace the value when called. for example i have the value for abc and ccc. now i have to substitute the value of value abc and ccc in the place of them. Input File: go to &abc=ddd; if... (16 Replies)
Discussion started by: saaisiva
16 Replies

5. UNIX for Advanced & Expert Users

Finding a Particular Pattern In UNIX

Hi, Suppose I have a file with many lines as follows. Now I want to find the following questions from the file through shell script or commands. My name is XYZ. XYZ works for GHT and XYZ is part of PES. GHT is a good organization. XYZ knows swimming. XYZ is also very keen in reading. XYZ is a... (2 Replies)
Discussion started by: sktkpl
2 Replies

6. UNIX for Dummies Questions & Answers

Finding a pattern with grep

I am interested in finding a pattern that looks like this AABBACC These letters are just for example but they can be any letter in the alphabet as long as they are different from each other, but the letter found in a certain spot should act like in the pattern above. Thanks! (7 Replies)
Discussion started by: moyzZ
7 Replies

7. UNIX for Dummies Questions & Answers

Finding a pattern

Hi, I have the below content in file: <xmlfile> ows_Body="Hi" ows_Title="Title" ows_Author="krishna" </xmlfile> I wanted to remove ows_Body content from the file. I am using the below code sed -e 's/ows_Body.*ows/ows/g' Giving output: (9 Replies)
Discussion started by: mahish20
9 Replies

8. Shell Programming and Scripting

Unix gurus : how to grep this pattern?

Hello Unix gurus, My log file has entries in below format : ================================================================= 2009-01-19-01.19.24.816169+660 I8635A1158 LEVEL: Error PID : 5873782 TID : 1 PROC : aaaa APPHDL : 0-269 AUTHID : PDBCMPC... (12 Replies)
Discussion started by: Rahulpict
12 Replies

9. Shell Programming and Scripting

Finding Last occurance of another pattern when a pattern is found.

Hi, I have two files viz, rak1: $ cat rak1 rak2: $ cat rak2 sdiff rak1 rak2 returns: I want the lines that got modified, changed, or deleted preceding with the section they are in. I have done this so far: (1 Reply)
Discussion started by: rakeshou
1 Replies

10. Shell Programming and Scripting

finding duplicate files by size and finding pattern matching and its count

Hi, I have a challenging task,in which i have to find the duplicate files by its name and size,then i need to take anyone of the file.Then i need to open the file and find for more than one pattern and count of that pattern. Note:These are the samples of two files,but i can have more... (2 Replies)
Discussion started by: jerome Sukumar
2 Replies
Login or Register to Ask a Question