Re: File to dict
- From: Bruno Desthuilliers <bruno.42.desthuilliers@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 07 Dec 2007 13:22:02 +0100
mrkafk@xxxxxxxxx a écrit :
Hello everyone,
(snip)
Say, I would like to transform a file containing entries like
the following into a list of lists with doublecolon treated as
separators, i.e. this:
tm:$1$aaaa$bbbb:1010:6::/home/owner1/imap/domain1.tld/tm:/sbin/nologin
would get transformed into this:
[ ['tm', '$1$aaaa$bbbb', '1010', '6', , '/home/owner1/imap/domain1.tld/
tm', '/sbin/nologin'] [...] [...] ]
The csv module is your friend.
.
- Follow-Ups:
- Re: File to dict
- From: mrkafk
- Re: File to dict
- References:
- File to dict
- From: mrkafk
- File to dict
- Prev by Date: Re: File to dict
- Next by Date: Re: File to dict
- Previous by thread: Re: File to dict
- Next by thread: Re: File to dict
- Index(es):