ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

DONE: Search a folder of text files for an expression, copy the line of text

(1/3) > >>

ohfine:
I am monitoring my internet connection (cable TV, phone, and internet) due to previous issues with the service frequently dropping off line.

I am using "EasyNetMonitor" which sends out a ping to Google.com every minute and then makes a one line log entry of “online” or “lost connection”. Each day has it's own text log file in the "Log" folder. This gives me an idea of how many times the service drops out and something to show the cable provider.

I have been copying each text log file, importing it into a spreadsheet, sorting for "lost connection", copy the results to another tab, delete the old tab, and then format the cell backgrounds based on date using alternating colors. The end result is monthly columns showing each lost connection with the days set off by alternating colors.

It works, but I was hoping somebody could help me develop a better way to get the job done. I am not a coder and only know enough about spreadsheets, macros, and batch files to get into trouble.

Any assistance would be appreciated.

skwire:
Can you provide some samples of your log files and the resulting spreadsheets you create?

Ath:
You could search google for 'logfile analyzer' (as I did), most top 10 results are free/open source tools with lots of features and options. I'd give one of them a go.

AndyM:
from a command prompt, the Find command will do what you ask

find "expression" Filename

It will output each line that includes 'expression'.  Standard output is to the monitor, but you can redirect the output to a file:

find "lost connection" LogfileName > OutputFilename

The Output text file will be a list of lines, each one including 'lost connection'.  You can then load this file into a spreadsheet and add your colors (conditional formatting perhaps, odd dates one color, even dates another?)

MilesAhead:
Also I'd look at some of the Linux utilities ported to Windows. Usually there are many more built in features than similar Windows command line tools. Grep and Find are good examples.  They may take some set up if they need  a bash shell environment.  But as example, find can search for a pattern and execute a command on every match.

Plus they tend to be stable rather than changing behavior with every minor OS version update.

Navigation

[0] Message Index

[#] Next page

Go to full version