Terry Hancock <[EMAIL PROTECTED]> wrote:
> The only problem I see is the "in place" requirement, which seems silly
> unless by "quite large" you mean multiple gigabytes. Surely Perl
> actually makes a copy in the process even though you never see
> it?
If using "perl -i" then then it does mak
Michael Hoffman wrote:
Greg Lindstrom wrote:
I have a file with varying length records. All but the first record,
that is; it's always 107 bytes long. What I would like to do is strip
out all linefeeds from the file, read the character in position 107
(the end of segment delimiter) and then re
Greg Lindstrom wrote:
I have a task which -- dare I say -- would be easy in
Perl but would rather do in Python (our primary
language at Novasys). I have a file with varying length records. All
but the first record, that is; it's always 107 bytes long.
I intuit that you are dealing with EDI
Greg Lindstrom wrote:
> Hello-
>
> I have a task which -- dare I say -- would be easy in
> Perl but would rather do in Python (our primary
> language at Novasys). I have a file with varying length records.
All
> but the first record, that is; it's always 107 bytes long. What I
would
> like to d
This might be hack-ish, more elegant solutions are likely to exist, but this
is the general idea:
LINEFEED = "\n" # or whatever
EOR = "?"# or whatever
def fixEOR(filename):
f = open(filename,"r+")
byte = True
# loops through whole file
while True:
# loops through record
On Wednesday 09 March 2005 04:06 pm, Greg Lindstrom wrote:
> Hello-
>
> I have a task which -- dare I say -- would be easy in
> Perl but would rather do in Python (our primary
> language at Novasys). I have a file with varying length records. All
> but the first record, that is; it's always
Greg Lindstrom wrote:
I have a file with varying length records. All
but the first record, that is; it's always 107 bytes long. What I would
like to do is strip out all linefeeds from the file, read the character
in position 107 (the end of segment delimiter) and then replace all of
the end o
Hello-
I have a task which -- dare I say -- would be easy in
Perl but would rather do in Python (our primary
language at Novasys). I have a file with varying length records. All
but the first record, that is; it's always 107 bytes long. What I would
like to do is strip out all linefeeds fr