On 22/01/2015 15:40, dw wrote:
Thanks for your good comments.
I do think I found a work around
body = ""
for x in range(0,len(line_array)):
test_line = len(re.findall(r'[0-9]{2}/[0-9]{2}/[0-9]{4}',
line_array[x]))
if test_line > 0:
body = body + line_array[x]+"\n"
Using
On 22/01/2015 16:15, dw wrote:
Thanks so much Steve and Mark!
You've given me a lot to chew on. :-D
I'll pursue!
More Python FUN!!
Thanks for the thanks, but please don't change the subject as it breaks
threading, making it more
Thanks for your good comments.
I do think I found a work around
body = ""
for x in range(0,len(line_array)):
test_line = len(re.findall(r'[0-9]{2}/[0-9]{2}/[0-9]{4}',
line_array[x]))
if test_line > 0:
body = body + line_array[x]+"\n"
For each iteration re.findall returns a lis
Thanks so much Steve and Mark!
You've given me a lot to chew on. :-D
I'll pursue!
More Python FUN!!
Based on your description, I think the best way to do this is:
# remove blank lines
line_array = [line for line in line_array if l
On 21/01/2015 18:14, dw wrote:
Hello Python Friends.
I have a string array, called "line_array".
There may be up to 50 or more elements in the array.
So:
- line_array[1] may contain "01/04/2013 10:43 AM17,410,217
DEV-ALL-01-04-13.rlc\n"
- line_array[2] may contain "01/25/2013 03:21 PM
How large will your array be in production?
If it going to be very large, you may want to consider a database.
You're simulating a collection of records as an in-memory sequence of
flat strings. This design won't scale, so if you are working with a
lot of data, you may want to look into a dedicat
On Wed, Jan 21, 2015 at 10:14:42AM -0800, dw wrote:
> Hello Python Friends.
> I have a string array, called "line_array".
Do you mean a list of strings? "String array" is not a standard Python
term, it could mean something from the array module, from numpy, or
something completely different.
It
On 21/01/15 18:14, dw wrote:
- line_array[1] may contain "01/04/2013 10:43 AM17,410,217
DEV-ALL-01-04-13.rlc\n"
- line_array[2] may contain "01/25/2013 03:21 PM17,431,230
DEV-ALL-01-25-2013.rlc\n"
- line_array[3] may contain "\n"
I want to retain all elements which are valid (
Hello Python Friends.
I have a string array, called "line_array".
There may be up to 50 or more elements in the array.
So:
- line_array[1] may contain "01/04/2013 10:43 AM17,410,217
DEV-ALL-01-04-13.rlc\n"
- line_array[2] may contain "01/25/2013 03:21 PM17,431,230
DEV-ALL-01-25-2