Parsing a long string string problem for procmail


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Parsing a long string string problem for procmail
# 1  
Old 09-08-2011
Parsing a long string string problem for procmail

Hi everyone,

I am working on fetchmail + procmail to filter mails and I am having problem with parsing a long line in the body of the email.

Could anyone help me construct a reg exp for this string below. It needs to match exactly as this string.

GetRyt |KLdipManagerImpl::ConditionCalledCall: mib: number output failed


The body of the email is something like this.

|17:08:05.972|0x00000DD8|-1| GetRyt |KLdipManagerImpl::ConditionCalledCall: mib: number output failed
|17:08:05.972|0x00000DD8|-1| GetNow |KLdipManagerImplnt::CondCallall: mibs: numbered output failed in queue

Thank in advance.
# 2  
Old 09-08-2011
Code:
grep 'GetRyt |KLdipManagerImpl::ConditionCalledCall: mib: number output failed'

# 3  
Old 09-08-2011
procmail uses egrep regular expressions so something like this should work for you:

Code:
GetRyt \|KLdipManagerImpl::ConditionCalledCall: mib: number output failed

# 4  
Old 09-09-2011
Hi Chubbler, i tried your solution but it didn't work. there's no match on the string.

If i remove the \ after | then it match anything that starts with GetRyt

Any idea?

thanks

Quote:
Originally Posted by Chubler_XL
procmail uses egrep regular expressions so something like this should work for you:

Code:
GetRyt \|KLdipManagerImpl::ConditionCalledCall: mib: number output failed

# 5  
Old 09-10-2011
Hello everyone.

Anyone have idea how to make it work?

I dont get any match if I use the sample below and without \ im getting false match.

GetRyt \|KLdipManagerImpl::ConditionCalledCall: mib: number output failed

Sample of the body of the message is something like this. I want to only match the first line of the sample.

|17:08:05.972|0x00000DD8|-1| GetRyt |KLdipManagerImpl::ConditionCalledCall: mib: number output failed
|17:08:05.972|0x00000DD8|-1| GetRyt |KLdipManagerImpl::ConditionCalledCall: mib: numbered output failed in queue

thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Inserting a long string (readable in sed)

Hi everyone, I am trying to insert a single very long string as the first line of a file, So the following sed commands does what I want; sed '1i\"","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"' file.txt Think that all the... (3 Replies)
Discussion started by: hayreter
3 Replies

2. Shell Programming and Scripting

Inserting into long delimited string using perl.

Hi, I have a very long pipe delimited string. The length of the string could vary. For example: START|one|two|three|four|five|six|seven START|one|two|three|four|five|six|seven|eight|nine START|one|two|three|four I want to replace in the third occurence of string with another... (9 Replies)
Discussion started by: som.nitk
9 Replies

3. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

4. Shell Programming and Scripting

Problem in comparing 2 files string by string

Hi Champs, I am a newbie to unix world, and I am trying to built a script which seems to be far tough to be done alone by me..... " I am having a raw csv file which contains around 50 fields..." From that file I have to grep 2 fields "A" and "B"....field "A" is to be aligned vertically... (11 Replies)
Discussion started by: jitendra.pat04
11 Replies

5. Shell Programming and Scripting

splitting long string into several lines?

I'm using a barcode scanner to grab ISBNs. Unfortunately, short of hitting "enter" each time (not easy while on a ladder), there's no good way to split it up. So I scanned it into a series of long lines in notepad. Now, I need to split each line into 12-number lines. instead of:... (4 Replies)
Discussion started by: mbourgon
4 Replies

6. UNIX for Dummies Questions & Answers

finding string in very long file without newlines

What's the best way to find a string in a very long file without newlines in Unix? The standard utility I'm aware of for finding a string in a single file is grep, but for a long file without newlines, I think the output is just going to be the input. I suppose I could use sed to replace the... (5 Replies)
Discussion started by: aaronpoley
5 Replies

7. Programming

String too long to view in GDB

Hi All Sometimes when I debug my C++ code with GDB an I want to view the content of my string variables I use the command "p <name of variable>" . When strings are very long and their displayed content is truncated. Do you know a way to see the whole content of those? Thanks M (5 Replies)
Discussion started by: manustone
5 Replies

8. Shell Programming and Scripting

Parsing of file for Report Generation (String parsing and splitting)

Hey guys, I have this file generated by me... i want to create some HTML output from it. The problem is that i am really confused about how do I go about reading the file. The file is in the following format: TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies

9. UNIX for Advanced & Expert Users

Long string

I have a long string in ASCII file of approx 60k bytes file size. I need to know 1.How many charcters are adjectly in string. export MAX_COL_SIZE=`awk "length>max{max=length}END{print max}" test.txt` this return file cann't open...can anyone advice why?? 2. How many 'TRX consist in my... (1 Reply)
Discussion started by: u263066
1 Replies

10. Shell Programming and Scripting

sed problem - replacement string should be same length as matching string.

Hi guys, I hope you can help me with my problem. I have a text file that contains lines like this: 78 ANGELO -809.05 79 ANGELO2 -5,000.06 I need to find all occurences of amounts that are negative and replace them with x's 78 ANGELO xxxxxxx 79... (4 Replies)
Discussion started by: amangeles
4 Replies
Login or Register to Ask a Question