(Shareware?) file search for huge file?

J

jdworley

Howdy!

The search is a 1 GB+ file from a crash to be exact - had an
e-mail correspondence (window) hopefully in it so I saved
the file on reboot before windoze kicked in and want to open
and search it for my e-mail, then delete the file...

Anyone know of a program to do that which can find and then
go up and down to extract or cut and paste my e-mail. It
took a day to write that e-mail and I can't imagine trying
to rewrite. Also, I COULD attempt to write a program myself
to do it, but my C is rusty X 5+ years and would take me all
day to get back in the saddle (hence the search for a
program to do the parsing for me).

It can run in DOS or under Win98 please... . but my compiler
is in a computer that I can't unpack at the moment, so a
down and dirty write in C won't help :-(

Thanks!

Steve
 
M

Mike Wahler

Howdy!

The search is a 1 GB+ file from a crash to be exact - had an
e-mail correspondence (window) hopefully in it so I saved
the file on reboot before windoze kicked in and want to open
and search it for my e-mail, then delete the file...

Anyone know of a program to do that which can find and then
go up and down to extract or cut and paste my e-mail.

Have you tried Microsoft Word or the WordPad application
that comes with Windows? With a file that large there
would probably be some VM thrashing, but if the data's
that important it should be worth the pain.
It
took a day to write that e-mail and I can't imagine trying
to rewrite. Also, I COULD attempt to write a program myself
to do it, but my C is rusty X 5+ years and would take me all
day to get back in the saddle (hence the search for a
program to do the parsing for me).

If the data's that important, is a day's work too much to pay
to get it back?

BTW your query is not really topical here. Google can find
enormous amounts of free software for virtually any application.
Have you tried Google?

-Mike
 
C

Chris Croughton

Indeed, it is worth it - but alas, that didn't work
(presumably wordpad can't open a file that big).

Search for grep on Google (Cygwin has one but you don't want to download
the whole of Cygwin just for grep). Or your Windows compiler tools may
provide grep. Then use that to search the file for a string you know
near the start of the message.

However, there is no guarantee that the data in memory was at all
contunuous. Indeed, if it was being edited it may well have been kept
as a linked list of lines or something stranger, so just finding one
line of the message may not be any indication at all of where the rest
of the message text was. It may not even be kept as ASCII text at all.
No, but programmers don't usually like to reinvent the wheel
- and surely someone has written this utility for themselves
and probably would love to share it.

For what email program? I can't even write such a program for the two I
use on Linux, I doubt if any two email programs use the same way of
storing messages being created.
Yes, I gave it a cursory (hour) look and ultimately it led
me here. As I stated, I'm simply too rusty to do this myself
in a timely fashion. I've rewritten the letter, but it was
missing a lot of important details and perhaps a few
"revelations", so I can't give up yet.

Look for 'grep' and 'strings', command-line Unix tools which have some
ports to Windows.

Also look for a binary editor, there are several available for Win32, my
favourite is XVI32, they generally have search facilities.
While the problem in its current incarnation doesn't rise to
the level of being fully on topic, it will if I begin coding
and brick wall on a few spots I don't remember correctly. I
figure open the file and close it to see how long it takes,
then seek some deep inward spot to see how long that takes
and decide on a buffer size from that? I can see this task
is going to be running two weeks plus if I don't model the
problem well enough first - so, THAT's why I asked if its
already out there first...

Just use the largest buffer available to you, there's no point in doing
seeks. If you want advice on core dump layout to decide where to start
you need to ask on an OS specific newsgroup. I don't see anything which
is particularly on-topic for comp.lang.c, you need an OS-specific
newsgroup (and/or one specific to your email program). Searching for
text in a file is simply a matter of reading the file and scanning the
data for the text, it's an algorithm problem not a C one...

Chris C
 
J

jdworley

Mike said:
Have you tried Microsoft Word or the WordPad application
that comes with Windows? With a file that large there
would probably be some VM thrashing, but if the data's
that important it should be worth the pain.

Indeed, it is worth it - but alas, that didn't work
(presumably wordpad can't open a file that big).
If the data's that important, is a day's work too much to pay
to get it back?

No, but programmers don't usually like to reinvent the wheel
- and surely someone has written this utility for themselves
and probably would love to share it.
BTW your query is not really topical here. Google can find
enormous amounts of free software for virtually any application.
Have you tried Google?

Yes, I gave it a cursory (hour) look and ultimately it led
me here. As I stated, I'm simply too rusty to do this myself
in a timely fashion. I've rewritten the letter, but it was
missing a lot of important details and perhaps a few
"revelations", so I can't give up yet.

While the problem in its current incarnation doesn't rise to
the level of being fully on topic, it will if I begin coding
and brick wall on a few spots I don't remember correctly. I
figure open the file and close it to see how long it takes,
then seek some deep inward spot to see how long that takes
and decide on a buffer size from that? I can see this task
is going to be running two weeks plus if I don't model the
problem well enough first - so, THAT's why I asked if its
already out there first...

Best,

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top