@python.org
Subject:Re: [Tutor] trouble with re
Ertl, John wrote:
> I have a file with 10,000 + lines and it has a coma delimited string on
each
> line.
>
> The file should look like:
>
> DFRE,ship name,1234567
> FGDE,ship 2,
> ,sdfsf
>
> The ,sdfsf line is bad
Ertl, John wrote:
> I have a file with 10,000 + lines and it has a coma delimited string on each
> line.
>
> The file should look like:
>
> DFRE,ship name,1234567
> FGDE,ship 2,
> ,sdfsf
>
> The ,sdfsf line is bad data
>
> p = re.compile('\d{7}$ | [,]$') # this is the line that I can not get
I have a file with 10,000 + lines and it has a coma delimited string on each
line.
The file should look like:
DFRE,ship name,1234567
FGDE,ship 2,
,sdfsf
The ,sdfsf line is bad data
Some of the lines are messed up...I want to find all lines that do not end
in a comma or seven digits and do som