Re: Question about Sun JAVAC

From: Kai-Uwe Bux (jkherciueh_at_gmx.net)
Date: 08/30/04


Date: Mon, 30 Aug 2004 02:09:28 -0400

Edward G. Nilges wrote:

> blmblm@myrealbox.com wrote in message
> news:<2pek8aFjidjhU1@uni-berlin.de>...
>> In article <f5dda427.0408282046.452b6e3d@posting.google.com>,
>> Edward G. Nilges <spinoza1111@yahoo.com> wrote:
>> >blmblm@myrealbox.com wrote in message
>> >news:<2pc6knFio079U1@uni-berlin.de>...
>> >> In article <f5dda427.0408271754.69403c35@posting.google.com>,
>> >> Edward G. Nilges <spinoza1111@yahoo.com> wrote:
>> >> [snip]
>> >> >Does linux in fact enable me to search my entire hard disk let us say
>> >> >for a files that contain foo OR are larger than 1M while containing
>> >> >boo?
>> >> >
>> >> >I'd say "without programming", but everything is "programming".
>> >> >Therefore can I enter a simple command
>> >> >
>> >> >findFile contains("foo") or size>1M and contains("boo")
>> >>
>> >> Well ....
>> >>
>> >> As you may remember, "grep" can identify files containing specified
>> >> text, and "find" can identify files over a particular size. I'm
>> >> pretty sure someone with more shell-using smarts than I have off the
>> >> top of my head could write a one-liner (or possibly a short script)
>> >> that would
>> >> accomplish your goal above. Of course it wouldn't be general, but the
>> >
>> >grep CANNOT to my knowledge READ the file.
>>
>> Read which file? If what you want to do is search for specified text
>> in a list of files, "grep" seems to me to be exactly the tool needed.
>> Some implementations even have a "--recursive" option that permits
>> searching a directory and all subdirectories.
>
> Yes, grep reads file contents. However, vanilla, "open" versions may
> have trouble with large ...

Finding a string within a file is linear in the length of the file unless
some indexing has been done beforehand. Until we have an indexing
filesystem that does this sort of preprocessing automatically, I would
presume that all versions (open and closed) of grep will take a long time
searching a complete hard drive.

> ... and with binary files, ...

If I want to avoid matches in binary files, I can use "grep -I"; and I am
using an "open" version of grep.

> ... and the objection remains that grep's notation is based on
> unreadable regular expressions.

Unreadable? If you are just searching for a string, the string itself will
be the regular expression you will want to use. What is unreadable about
that? Regular expression were designed so that you do not need messy stuff
for simple things. But I guess, what someone considers messy or simple is
more or less a cultural thing.

Best

Kai-Uwe Bux



Relevant Pages

  • Re: partial / wildcard string match in in and list.index()
    ... > to exact matching. ... There is a regular expression library, aptly called 're', for non-exact ... The standard string methods only do exact searching likely because there ...
    (comp.lang.python)
  • Re: how to split a string using ,fixed character length, variable text delimmiter
    ... a string in encountered that is at least 20 characters long, ... you could try using a regular expression such as this: ... you'd just be searching the text in question for occurrences of the ... out whether any given string has the correct maximum length. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: String searching and lienar optimization
    ... There are *lots* of things known about pattern matching. ... string: "fjwkrjweoriosdaicfosdifidoiasosifosdifosdfio" for example.. ... Can this problem be posed suitable lfor linear optimization? ... What I am trying to do is to structure a string searching ...
    (sci.math.num-analysis)
  • RE: Oject value changing in a loop
    ... Sub zString_FindGeneral(ByRef IFindThis As String, ... ByRef IFmRow As Long, ByRef IFmCol As Integer, ByRef IToRow As Long, ByRef ... ' OFoundQty is the number of cells found containing the IFindThis string. ... 'Lines A, D, E work when searching one or multiple worksheets ...
    (microsoft.public.excel.programming)
  • Re: Parameter Query Form Problem
    ... Dim stDocName As String ... This is what I used to make my query, its was a Microsoft support site. ... controls on the form so it can run the query. ... Combo Box for searching Customer Name ...
    (microsoft.public.access.formscoding)