LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search a file on Hard Drive for Strings (without bringing into memory)

Similar to how Microsoft allows one to search a folder of documents for words inside of a document, I wonder how this can be done in LabVIEW.  LabVIEW has binary seek capability to go to a particular byte location in a file on a hard drive.  But what would be a good strategy for searching the hard drive for a string without bringing the file bytes into memory?

 

Don

0 Kudos
Message 1 of 3
(2,383 Views)

That's sort of like saying, I want to go swimming but don't want to get wet. Smiley Very Happy

 

Windows can do a lot of things (I suspect) because they have much more direct access to the disks than applications do. For example, the ability to search the contents of files in Windows is limited to plain text files. This leads me to think that Windows is scanning the disk contents directly without worrying about file structure. When it finds the string you are looking for, it then looks to see what file its in.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 3
(2,377 Views)

You're going to have to read the file into memory - that's unavoidable. You don't have to read the entire file into memory at once, though - you can read a short section, search for item you want, then move on to the next chunk of the file. To avoid the problem of the search phrase crossing the boundary of a chunk, overlap the chunks slightly. I'd guess that's what Windows does too - MikePorter's comment doesn't make much sense to me.

0 Kudos
Message 3 of 3
(2,352 Views)