Split file into several and reformat

Amit Khemka khemkaamit at gmail.com
Thu Jun 21 14:51:14 CEST 2007


On 6/21/07, bomber71 at aapt.net.au <bomber71 at aapt.net.au> wrote:
> Hi,
>
> I want to take read an input file (sels.txt) that looks like:
>
> Begin sels
>    sel1 = {1001, 1002, 1003, ...
>            ...
>            1099}
>
>    sel2 = {1001, 1008, 1009 ...
>            ...
>            1299}
> End sels
>
> And turn it into an output file for each of the "sels" in the input file, i.e
> sel1.txt:
<snip>

Once you have read Bruno's pointers ! Have a look at
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/521877

cheers,
----
Amit Khemka --
Co-founder: OnYoMo
website: www.onyomo.com
wap-site: www.owap.in
Home Page: www.cse.iitd.ernet.in/~csd00377

Endless the world's turn, endless the sun's Spinning, Endless the quest;
I turn again, back to my own beginning, And here, find rest.



More information about the Python-list mailing list