>
>
> "Jay Mutter III" <[EMAIL PROTECTED]> wrote
>
>
>> Whether I attempt to just strip the string or attempt to
>>
>> if line.endswith('No.\r'):
>> line = line.rstrip()
>>
>> It doesn't work.
>
> Ca
-
>
> Message: 4
> Date: Sun, 1 Apr 2007 16:46:05 +0100
> From: "Alan Gauld" <[EMAIL PROTECTED]>
> Subject: Re: [Tutor] Tutor Digest, Vol 38, Issue 1
> To: tutor@python.org
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain;
t/plain; format=flowed; charset="iso-8859-1";
> reply-type=original
>
>
> "Jay Mutter III" <[EMAIL PROTECTED]> wrote
>
>> for line in s:
>> jay = patno.findall(line)
>> jay2 = "".join(jay[0])
>> print jay2
>>
in a certain pattern?
For instance, if line ends with the abbreviation No.
I want to join the current line with next line.
Are lists immutable or can they be changed?
Thanks again
jay
On Mar 31, 2007, at 2:27 PM, Kent Johnson wrote:
> Jay Mutter III wrote:
>> I have the following that
Ok after a minute of thought I did solve my second question by simply
changing my RE to
(r'(\d{1}[\s,.]+\d{3}[\s,.]+\d{3})')
but still haven't gotten he first one.
On Mar 31, 2007, at 1:39 PM, Jay Mutter III wrote:
> I have the following that I am using to extract &qu
I have the following that I am using to extract "numbers' from a file
prompt1 = raw_input('What is the file from which you would like a
list of patent numbers? ')
p1 = open(prompt1,'rU')
s = p1.readlines()
prompt2 = raw_input('What is the name of the file to which you would
like to save
ot;
>
> Message: 2
> Date: Sat, 24 Mar 2007 19:25:10 -0400
> From: Jay Mutter III
> Subject: [Tutor] parsing text
> [...]
> 1.) when i do readlines and create a list and then print the list it
> adds a blank line between every line of text
> [...]
> ideas?
>
place(s,'p.','\n') in an attempt to put a CR in but
it just put the characters\n in the string.
ideas?
Thanks again
jay
Jay Mutter III wrote:
> Thanks for the response
> Actually the number of lines this returns is the same number of lines
> given when i put it
Script i have to date is below and
Thanks to your help i can see some daylight but I still have a few
questions
1.) Are there better ways to write this?
2.) As it writes out the one group to the new file for companies it
is as if it leaves blank lines behind for if I don't have the elif len
gt; f.close()
>>>
Note the differing placement of the f.close() statement, it's not
part of the while.
On 3/22/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
Jay Mutter III wrote:
> Why is it that when I run the following interactively
>
> f = open('Patents-1920.txt
Andre;
Thanks again for the assistance.
I have corrected the splitlines error and it works ( well that part
of anyway) correctly now.
On Mar 23, 2007, at 5:30 AM, Andre Engels wrote:
2007/3/22, Jay Mutter III <[EMAIL PROTECTED]>:
I wanted the following to check each line and if it e
First thanks for all of the help
I am actually starting to see the light.
On Mar 22, 2007, at 7:51 AM, Kent Johnson wrote:
> Jay Mutter III wrote:
>> Kent;
>> Thanks for the reply on tutor-python.
>> My data file which is just a .txt file created under WinXP by an
>>
On Mar 23, 2007, at 5:30 AM, Andre Engels wrote:
2007/3/22, Jay Mutter III <[EMAIL PROTECTED]>:
I wanted the following to check each line and if it ends in a right
parentheses then write the entire line to one file and if not then
write the line to anther.
It wrote all of the ) to one fi
I wanted the following to check each line and if it ends in a right
parentheses then write the entire line to one file and if not then
write the line to anther.
It wrote all of the ) to one file and the rest of the line (ie minus
the ) to the other file.
in_filename = raw_input('What is the
Why is it that when I run the following interactively
f = open('Patents-1920.txt')
line = f.readline()
while line:
print line,
line = f.readline()
f.close()
I get an error message
File "", line 4
f.close()
^
SyntaxError: invalid syntax
but if i run it in a script there is no
"Jay Mutter III" wrote
> See example next:
> A.-C. Manufacturing Company. (See Sebastian, A. A.,
> and Capes, assignors.)
>...
>Aaron, Solomon E., Boston, Mass. Pliers. No. 1,329,155 ;
>Jan. 27 ; v. 270 ; p. 554.
>
> For instance, I would like to go to end of
I am using an intel iMac with OS -X 10.4.8.
It has Python 2.3.5.
My issue is that I have a lot of text ( about 500 pages at the
moment) that I need to parse so that I can eliminate info I don't
need, break the remainder into fields and put in a database/spreadsheet.
See example next:
A.-C.
17 matches
Mail list logo