On Jan 30, 3:49 am, "Diez B. Roggisch" wrote:
> alex23 gave you a set of tools that you can use for full-text-search.
> However, that's not necessarily the best thing to do if things have a
> record-like structure.
In Nucular (and others I think) you can do searches
for terms anywhere (full text)
2009/1/30 Scott David Daniels :
> Be careful with your assertion that a regex is faster, it is certainly
> not always true.
I was careful *not* to assert that a regex would be faster, merely
that it was *likely* to be in this case.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-
Quoth Tim Chase :
> rdmur...@bitdance.com wrote:
> > What you want is:
> >
> > from fnmatch import fnmatch
>
> Oh, that's head-smackingly obvious now...thanks!
>
> My thought process usually goes something like
>
> """
> I want to do some file-name globbing
>
> there's a glob module that l
rdmur...@bitdance.com wrote:
Quoth Tim Chase :
PS: as an aside, how do I import just the fnmatch function? I
tried both of the following and neither worked:
from glob.fnmatch import fnmatch
from glob import fnmatch.fnmatch
I finally resorted to the contortion coded below in favor of
Tanks everyone that spent time helping my, the help was great.
Best regards Anders
--
http://mail.python.org/mailman/listinfo/python-list
Quoth Tim Chase :
> PS: as an aside, how do I import just the fnmatch function? I
> tried both of the following and neither worked:
>
>from glob.fnmatch import fnmatch
>from glob import fnmatch.fnmatch
>
> I finally resorted to the contortion coded below in favor of
>import glob
>
I have written a Python program that serach for specifik customer in
files (around 1000 files)
the trigger is LF01 + CUSTOMERNO
While most of the solutions folks have offered involve scanning
all the files each time you search, if the content of those files
doesn't change much, you can build a
>
>
> Today this works fine, it saves me a lot of manuall work, but a seach
> takes around 5 min,
> so my questin is is there another way of search in a file
> (Today i step line for line and check)
>
If the files you are searching are located at some other location on a
network, you may find that
Diez B. Roggisch wrote:
> that's not necessarily the best thing to do if things have a
> record-like structure. The canonical answer to this is then to use a
> database to hold the data, instead of flat files. So if you have any
> chance to do that, you should try & stuff things in there.
It's wor
D'Arcy J.M. Cain wrote:
> On Fri, 30 Jan 2009 15:46:33 +0200
> Justin Wyer wrote:
>> $ find -name "*" -exec grep -nH "LF01" {} \;
>> | cut -d ":" -f 1 | sort | uniq
>
> I know this isn't a Unix group but please allow me to suggest instead;
>
> $ grep -lR LF01
That's a very good advice. I ha
D'Arcy J.M. Cain druid.net> writes:
>
> On Fri, 30 Jan 2009 15:46:33 +0200
> Justin Wyer gmail.com> wrote:
> > $ find -name "*" -exec grep -nH "LF01" {} \;
> > | cut -d ":" -f 1 | sort | uniq
>
> I know this isn't a Unix group but please allow me to suggest instead;
>
> $ grep -lR LF01
Tim Rowe wrote:
But even without going to a full database solution it might
be possible to make use of the flat file structure. For example, does
the "LF01" have to appear at a specific position in the input line? If
so, there's no need to search for it in the complete line. *If* there
is an
2009/1/30 Diez B. Roggisch :
> No. Because nobody can automagically infer whatever structure your files
> have.
Just so. But even without going to a full database solution it might
be possible to make use of the flat file structure. For example, does
the "LF01" have to appear at a specific positi
On Fri, 30 Jan 2009 15:46:33 +0200
Justin Wyer wrote:
> $ find -name "*" -exec grep -nH "LF01" {} \;
> | cut -d ":" -f 1 | sort | uniq
I know this isn't a Unix group but please allow me to suggest instead;
$ grep -lR LF01
--
D'Arcy J.M. Cain | Democracy is three wolves
http://www
On Fri, Jan 30, 2009 at 1:51 AM, anders wrote:
> Hi!
> I have written a Python program that serach for specifik customer in
> files (around 1000 files)
> the trigger is LF01 + CUSTOMERNO
>
> So a read all fils with dirchached
>
> Then a loop thru all files each files is read with readLines() and
Hi!
I have written a Python program that serach for specifik customer in
files (around 1000 files)
the trigger is LF01 + CUSTOMERNO
So a read all fils with dirchached
Then a loop thru all files each files is read with readLines() and
after that scaned
Today this works fine, it saves me a lot of
anders schrieb:
Hi!
I have written a Python program that serach for specifik customer in
files (around 1000 files)
the trigger is LF01 + CUSTOMERNO
So a read all fils with dirchached
Then a loop thru all files each files is read with readLines() and
after that scaned
Today this works fine, it
On Jan 30, 2:56 pm, r wrote:
> On Jan 29, 5:51 pm, anders wrote:
>
> > if file.findInFile("LF01"):
> > Is there any library like this ??
> > Best Regards
> > Anders
>
> Yea, it's called a for loop!
>
> for line in file:
> if "string" in line:
> do_this()
Which is what the OP is alrea
On Jan 29, 5:51 pm, anders wrote:
> if file.findInFile("LF01"):
> Is there any library like this ??
> Best Regards
> Anders
Yea, it's called a for loop!
for line in file:
if "string" in line:
do_this()
--
http://mail.python.org/mailman/listinfo/python-list
19 matches
Mail list logo