join , split question

View: New views
8 Messages — Rating Filter:   Alert me  

join , split question

by elca :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,
i have some text file list such like following format.
i want to change text format to other format.
 i was upload it pastebin site
http://elca.pastebin.com/d71261168

if anyone help ,much appreciate thanks in advance

Parent Message unknown Re: join , split question

by Bruno Desthuilliers-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

elca a écrit :
> Hello,
> i have some text file list such like following format.
> i want to change text format to other format.
>  i was upload it pastebin site
> http://elca.pastebin.com/d71261168

Dead link.

> if anyone help

With what ?
--
http://mail.python.org/mailman/listinfo/python-list

Re: join , split question

by Stuart Murray-Smith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>> Hello, i have some text file list such like following format.
>> i want to change text format to other format.
>>  i was upload it pastebin site
>> http://elca.pastebin.com/d71261168

> Dead link.

> With what ?

http://elca.pastebin.com/d4d57929a

:)
--
http://mail.python.org/mailman/listinfo/python-list

Parent Message unknown Re: join , split question

by Bruno Desthuilliers-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Stuart Murray-Smith a écrit :

>>> Hello, i have some text file list such like following format.
>>> i want to change text format to other format.
>>>  i was upload it pastebin site
>>> http://elca.pastebin.com/d71261168
>
>> Dead link.
>
>> With what ?
>
> http://elca.pastebin.com/d4d57929a
>

Yeah, fine. And where's the code you or the OP (if not the same person)
have problems with ?

--
http://mail.python.org/mailman/listinfo/python-list

Re: join , split question

by Jon Clements-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Nov 5, 2:08 pm, Bruno Desthuilliers <bruno.
42.desthuilli...@...> wrote:

> Stuart Murray-Smith a écrit :
>
> >>> Hello, i have some text file list such like following format.
> >>> i want to change text format to other format.
> >>>  i was upload it pastebin site
> >>>http://elca.pastebin.com/d71261168
>
> >> Dead link.
>
> >> With what ?
>
> >http://elca.pastebin.com/d4d57929a
>
> Yeah, fine. And where's the code you or the OP (if not the same person)
> have problems with ?

I'd certainly be curious to see it, especially with the pagecheck()
line 22 @ http://elca.pastebin.com/f5c69fe41

--
http://mail.python.org/mailman/listinfo/python-list

Parent Message unknown Re: join , split question

by metal-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 11月4日, 下午5时39分, elca <high...@...> wrote:
> Hello,
> i have some text file list such like following format.
> i want to change text format to other format.
>  i was upload it pastebin sitehttp://elca.pastebin.com/d71261168
>
> if anyone help ,much appreciate thanks in advance
> --
> View this message in context:http://old.nabble.com/join-%2C-split-question-tp26193334p26193334.html
> Sent from the Python - python-list mailing list archive at Nabble.com.

s = """uji708
uhodih
utus29
agamu4
azi340
ekon62
"""

from itertools import cycle
for i, x in zip(cycle(range(3)), s.splitlines()):
    print x + ',',
    if i == 2:
        print

"""
uji708, uhodih, utus29,
agamu4, azi340, ekon62,
"""
--
http://mail.python.org/mailman/listinfo/python-list

Re: join , split question

by metal-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 11月6日, 上午8时34分, metal <metal...@...> wrote:

> On 11月4日, 下午5时39分, elca <high...@...> wrote:
>
> > Hello,
> > i have some text file list such like following format.
> > i want to change text format to other format.
> >  i was upload it pastebin sitehttp://elca.pastebin.com/d71261168
>
> > if anyone help ,much appreciate thanks in advance
> > --
> > View this message in context:http://old.nabble.com/join-%2C-split-question-tp26193334p26193334.html
> > Sent from the Python - python-list mailing list archive at Nabble.com.
>
> s = """uji708
> uhodih
> utus29
> agamu4
> azi340
> ekon62
> """
>
> from itertools import cycle
> for i, x in zip(cycle(range(3)), s.splitlines()):
>     print x + ',',
>     if i == 2:
>         print
>
> """
> uji708, uhodih, utus29,
> agamu4, azi340, ekon62,
> """

yet another version, a little evil

s = """uji708
uhodih
utus29
agamu4
azi340
ekon62
"""

from itertools import *
print '\n'.join(','.join(x for i, x in g) for k, g in groupby(enumerate
(s.splitlines()), lambda (i, x): i/3))
"""
uji708,uhodih,utus29
agamu4,azi340,ekon62
"""
--
http://mail.python.org/mailman/listinfo/python-list

Re: join , split question

by elca :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Jon Clements-2 wrote:
On Nov 5, 2:08 pm, Bruno Desthuilliers <bruno.
42.desthuilli...@websiteburo.invalid> wrote:
> Stuart Murray-Smith a écrit :
>
> >>> Hello, i have some text file list such like following format.
> >>> i want to change text format to other format.
> >>>  i was upload it pastebin site
> >>>http://elca.pastebin.com/d71261168
>
> >> Dead link.
>
> >> With what ?
>
> >http://elca.pastebin.com/d4d57929a
>
> Yeah, fine. And where's the code you or the OP (if not the same person)
> have problems with ?

I'd certainly be curious to see it, especially with the pagecheck()
line 22 @ http://elca.pastebin.com/f5c69fe41

--
http://mail.python.org/mailman/listinfo/python-list
thanks all!
i was resolved :)