Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 4th, 2005, 2:19 AM   #1
sindre
Newbie
 
Join Date: Apr 2005
Posts: 1
Rep Power: 0 sindre is on a distinguished road
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
sindre is offline   Reply With Quote
Old May 19th, 2005, 3:49 PM   #2
mackenga
Professional Programmer
 
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 314
Rep Power: 4 mackenga is on a distinguished road
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.
mackenga is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:48 PM.

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