Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

join , split question

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


highcar at gmail

Nov 4, 2009, 1:39 AM

Post #1 of 8 (358 views)
Permalink
join , split question

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
--
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.

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


bruno.42.desthuilliers at websiteburo

Nov 5, 2009, 1:25 AM

Post #2 of 8 (340 views)
Permalink
Re: join , split question [In reply to]

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


eight32 at gmail

Nov 5, 2009, 1:54 AM

Post #3 of 8 (340 views)
Permalink
Re: join , split question [In reply to]

>> 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


bruno.42.desthuilliers at websiteburo

Nov 5, 2009, 6:08 AM

Post #4 of 8 (336 views)
Permalink
Re: join , split question [In reply to]

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


joncle at googlemail

Nov 5, 2009, 9:40 AM

Post #5 of 8 (337 views)
Permalink
Re: join , split question [In reply to]

On Nov 5, 2:08pm, 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


metal29a at gmail

Nov 5, 2009, 4:34 PM

Post #6 of 8 (325 views)
Permalink
Re: join , split question [In reply to]

On 11月4日, 下午5时39分, elca <high...@gmail.com> 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


metal29a at gmail

Nov 5, 2009, 4:46 PM

Post #7 of 8 (329 views)
Permalink
Re: join , split question [In reply to]

On 11月6日, 上午8时34分, metal <metal...@gmail.com> wrote:
> On 11月4日, 下午5时39分, elca <high...@gmail.com> 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


highcar at gmail

Nov 5, 2009, 6:08 PM

Post #8 of 8 (326 views)
Permalink
Re: join , split question [In reply to]

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 :)

--
View this message in context: http://old.nabble.com/join-%2C-split-question-tp26193334p26225646.html
Sent from the Python - python-list mailing list archive at Nabble.com.

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

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.