Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Bash / Shell Scripting (http://www.programmingforums.org/forum26.html)
-   -   validate USENET posts (http://www.programmingforums.org/showthread.php?t=3083)

sindre Apr 4th, 2005 2:19 AM

validate USENET posts
 
I have a file with a lot of USENET posts.

I need a tool wich can validate the posts in this file and write a list of the valid posts.

the posts begins with:

From f.nurk@aol.com Fri Mar 11 10:28:59 2005
From: "Fred Nurk" <f.nurk@aol.com>
Newsgroups: comp.os.linux.misc
References: <427df_1@news.tm.net.my> <38r7qF5sn4U7@individual.net>
Subject: Re: Find Linux OS Brand and Version
Date:Fri, 4 Mar 200517:38:35 +0100
MIME-Version: 1.0
++ some more header fields

the tool need to check that the message begins with these headers fields
, and if they do list them to std output.

any tips on how to begin such a tool?


sH

mackenga May 19th, 2005 3:49 PM

Very briefly, regular expressions. I'd write this tool in Perl, but Tcl would do too since it has good regexp support.

There's a regexp tutorial at http://analyser.oli.tudelft.nl/regex/index.html.en and information on Perl and Tcl at http://www.perl.org/ and http://www.tcl.tk/ respectively. Tcl is easier to pick up quickly if you don't know either language.

I don't think I'd try to tackle this with a shell script, although I know some die-hards who would.


All times are GMT -5. The time now is 9:49 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC