Haibao Tang wrote:
> I have a two-column data file like this
> 1.12.3
> 2.211.1
> 4.31.1
> ...
> Is it possible to substitue all '1.1' to some value else without using
> re.
I suppose that you don't want '11.1' to be affected.
raw_data="""
1.12.3
2.211.1
4.31.1
"""
data =
Haibao Tang wrote:
> Is it possible to substitue all '1.1' to some value else without using
> re.
You could try:
import sys
values = sys.stdin.readline().split()
while values:
results = []
for value in values:
if value != '1.1':
results.append(value)
else:
"Haibao Tang" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I have a two-column data file like this
> 1.12.3
> 2.211.1
> 4.31.1
> ...
> Is it possible to substitue all '1.1' to some value else without using
> re.
>
Yes --
data = """1.12.3
2.211.1
4.31.1"""
I have a two-column data file like this
1.12.3
2.211.1
4.31.1
...
Is it possible to substitue all '1.1' to some value else without using
re.
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list