On Jan 30, 3:49 am, Diez B. Roggisch de...@nospam.web.de 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
Tanks everyone that spent time helping my, the help was great.
Best regards Anders
--
http://mail.python.org/mailman/listinfo/python-list
rdmur...@bitdance.com wrote:
Quoth Tim Chase t...@thechases.com:
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
Quoth Tim Chase python.l...@tim.thechases.com:
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
2009/1/30 Scott David Daniels scott.dani...@acm.org:
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
--
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
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
On Fri, Jan 30, 2009 at 1:51 AM, anders anders.u.pers...@gmail.com 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
On Fri, 30 Jan 2009 15:46:33 +0200
Justin Wyer justinw...@gmail.com wrote:
$ find path_to_dirs_containing_files -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 path_to_dirs_containing_files
2009/1/30 Diez B. Roggisch de...@nospam.web.de:
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
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 any
D'Arcy J.M. Cain darcy at druid.net writes:
On Fri, 30 Jan 2009 15:46:33 +0200
Justin Wyer justinwyer at gmail.com wrote:
$ find path_to_dirs_containing_files -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
D'Arcy J.M. Cain wrote:
On Fri, 30 Jan 2009 15:46:33 +0200
Justin Wyer justinw...@gmail.com wrote:
$ find path_to_dirs_containing_files -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
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 worth
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 much
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
Quoth Tim Chase t...@thechases.com:
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
On Jan 29, 5:51 pm, anders anders.u.pers...@gmail.com 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
On Jan 30, 2:56 pm, r rt8...@gmail.com wrote:
On Jan 29, 5:51 pm, anders anders.u.pers...@gmail.com 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
19 matches
Mail list logo