473,320 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

I need to search a string in a text file and send a mail incase the string is found

I need to search a string in a text file(to be more specific its a log file) and send a mail incase the string is found .
Jan 5 '11 #1
5 1997
Dheeraj Joshi
1,123 Expert 1GB
Why you want to send an Email after searching the file, why not when the event is logged?

Regards
Dheeraj Joshi
Jan 5 '11 #2
ya actually i want to send an mail when the event is logged, stating that event. Its like if the evnt is critical then I will have to send an email stating the entire event and what error occured.
Jan 5 '11 #3
Dheeraj Joshi
1,123 Expert 1GB
Check this out.

Regards
Dheeraj Joshi
Jan 5 '11 #4
nathj
938 Expert 512MB
It looks like the Java Mail classes are the way forward and they are fairly easy to use too. If you get stuck with them post back - I'll keep an eye on this thread as I have some experience using these classes.

If you do need to check a file for a string then take a look here. I haven't written or reviewed this code but at first glance the basic principles seems to be spot on.

Hope this is helpful and remember to shout if you get stuck.
nathj
Jan 6 '11 #5
I also have the same requirement as above, could anyone please give methis code
Jan 6 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: mashraf | last post by:
Hi, I am trying to send Mail from VB.net app but I can not do it. Even I can not do this = Imports system.mail, the mail option is not available. I also have to do more then one atachements. Some...
4
by: Alessandro | last post by:
Hi. How can I save multiple reports to ONE text file? I've used the OutputTo function, but the result is one text file for each report. I'm not a MS Access programmer and I don't know if I can...
4
by: suzy | last post by:
hello, i want to search a text file for an occurrence of a string and replace some text after the match, then save the file. eg: if the file is: <start> Hello my name is tony, I am 22....
60
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't...
1
by: Andrew | last post by:
Hi, im trying to create a small function which can create a binary tree from the entries in a text file and after that we can perform all the usual operations like search, insert and delete etc....
0
by: SimplySuzy | last post by:
Help I am trying to open a text file that I am naming dynamically through global variables in a dts package. When I print the file name to the screen, it is correct. When I use the dts package...
3
by: mse07 | last post by:
hi all i search about statement in text file by this code : LineFlag = LineFlag + 1 Line Input #1, strLine If LineFlag = 15 Then If InStr(1, strLine, " Transfer completed...
8
by: ImanMan | last post by:
hi Am using the following code to search a textfile.The returned value will always be found in this case, is there any problem in the code?? Dim list As...
4
by: dexter48 | last post by:
Hi I'm searching for a string occurance in a text file. I find the string ok and write the results to a log file. But on the line above is also some information I need. How can i get that. The string...
1
by: ahmed222too | last post by:
i use vb6 i want to make a backword search in text file i mean (by backword search) to begin the search from the last for example (i will go to school to learn more....) i want to find the last...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.