can python do this?
Jason
it at onestopent.com.au
Tue Jun 13 02:39:23 EDT 2000
wow thanks for the quick reply!
but can you explain what you wrote for me pls...i am new to the syntax...
where would i put the original text file to run this script on it? etc...
i am running on windoze 98 at work....
thanks
jason
Courageous <jkraska1 at san.rr.com> wrote in message
news:3945D0AA.E8F51A9C at san.rr.com...
>
> Q: "Can python do this?"
> A: "Python was born for it, baybee!"
>
> import string
> file = open ("file")
> lines = file.readlines()
> for line in lines:
> pair = string.split(line,":")
> print pair[0] +": "+ `string.split(string.strip(pair[1]),",")`
> file.close()
>
> --
>
> >>> import process
> FORM: ['Popular Recording']
> CMTYPESWITCH: ['Popular']
> RELOCORIGINAL: ['55864A2603AC94ACCA2568F200224388']
> CMCOUNTRY_ORIGIN: ['']
> CMGENRE_CODE: ['']
> **CPTITLE: ['INFINITE POSSIBILITIES']
> **CPARTIST: ['AMEL LARRIEUX']
> CPOARTISTS: ['']
> **CMCATNUMBER: ['4948792']
> **CMAPN: ['9399700067507']
> **CMARIAPRICECODE: ['C9921']
> **CMARIAMEDIACODE: ['21']
> **CMARIADISTRIBUTORCODE: ['SMA']
> CMARIAPACKAGECODE: ['']
> **DMRELEASE: ['19/06/2000']
> cMDateFormat: ['19/06/2000 12']
> DMDELETE: ['']
> cMDeleteStatus: ['No']
> **CMLISTPTRACKS: ['GET UP', 'I N I', 'SWEET MISERY', "SEARCHIN' FOR MY
SOUL", 'EVEN IF', 'INFINITE
> POSSIBILITES', 'SHINE', 'DOWN', 'WEATHER', 'MAKE ME WHOLE', 'GET UP
(THREAD HAD FUN MAIN MI', 'GET
> UP (MV MIG MIX (RADIO))']
> CMLISTPARTISTS: ['', '', '', '', '', '', '', '', '', '', '', '']
> RELOCMEDIA: ['F73C80183A01A8D7CA2568F2002A5517']
> **CURMPRICE: ['15.91']
> **CMTYPE: ['Compact Disc']
> CMRECORDCOMPANY: ['SONY MUSIC']
> CMPACKAGE: ['']
> CMARIADISTRIBUTORHOUSECODE: ['']
> cDistributorHouse: ['']
> CMLOCALE: ['Y']
> $UpdatedBy: ['CN=PPT/OU=AEROS/O=JUKEBOX']
> $Revisions: ['02/06/2000 05']
> >>>
More information about the Python-list
mailing list