Split single file into multiple files based on patterns

David Hutto dwightdhutto at gmail.com
Wed Oct 24 04:02:17 EDT 2012


On Wed, Oct 24, 2012 at 3:52 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Tue, 23 Oct 2012 20:01:03 -0700, satyam wrote:
>
>> I have a text file like this
>>
>> A1980JE39300007 2732 4195 12.527000
> [...]
>
>> I want to split the file and get multiple files like A1980JE39300007.txt
>> and A1980KK18700010.txt, where each file will contain column2, 3 and 4.
>
> Are you just excited and want to tell everyone, or do you actually have a
> question?
>
> Have you tried to write some code, or do you just expect others to do
> your work for you?
>
> If so, I see that your expectation was correct.
>
>
>
> --
> Steven

Some learn better with a full example, better than any small challenge
that can be thrown in at certain times.

I think it should be a little of both, especially if you (an
algorithmitist for the OP)only have enough time to throw out untested
pseudo code.

-- 
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com



More information about the Python-list mailing list