It is exactly what Peter has said. Opened the file with 'U' and it worked
like a charm.
Thank you very much!
On 28 November 2015 at 19:10, Peter Otten <__pete...@web.de> wrote:
> Br. Sayan wrote:
>
> > I am doing the following :
> >
> > with open('Manwal.txt') as infile, open('Manwal_req.txt','
Br. Sayan wrote:
> I am doing the following :
>
> with open('Manwal.txt') as infile, open('Manwal_req.txt','w') as outfile:
> for line in infile:
> if line.startswith(('R')):
> outfile.write(line)
>
> It is executing without error but returns a blank file. Where is the
>
On 28/11/15 11:22, Br. Sayan wrote:
> I am doing the following :
>
> with open('Manwal.txt') as infile, open('Manwal_req.txt','w') as outfile:
> for line in infile:
> if line.startswith(('R')):
> outfile.write(line)
>
> It is executing without error but returns a blank fil
I am doing the following :
with open('Manwal.txt') as infile, open('Manwal_req.txt','w') as outfile:
for line in infile:
if line.startswith(('R')):
outfile.write(line)
It is executing without error but returns a blank file. Where is the
problem?
On 27 November 2015 at 22:
In a message of Sat, 28 Nov 2015 16:52:07 +0530, "Br. Sayan" writes:
>I am doing the following :
>
>with open('Manwal.txt') as infile, open('Manwal_req.txt','w') as outfile:
>for line in infile:
>if line.startswith(('R')):
>outfile.write(line)
>
>It is executing without erro
In a message of Fri, 27 Nov 2015 17:05:21 +0530, "Br. Sayan" writes:
>How can we read specific lines from a text files using python. File
>attached.
>
>Suppose we want to read lines starting with 'R|1|^^^' and 'O|1|'
>
>Should we use:
>
>line.startswith(("..", "..", ""))
that matches lines tha
How can we read specific lines from a text files using python. File
attached.
Suppose we want to read lines starting with 'R|1|^^^' and 'O|1|'
Should we use:
line.startswith(("..", "..", ""))
H|\^&|||C311^1|host|RSUPL^BATCH|P|1
P|1
O|1|9060^MANWAL
^1^^010|R1|^^^989/\^^^99