On 01/07/2011 06:29 PM, PyProg PyProg wrote: > 2011/1/7 Corey Richardson <kb1...@aim.com>: > > Hi, > > Thanks for your response. > >> A google search yields no results for one. If you know the structure of >> the MPL file, you can write your own parser. Look through the file with >> a hex editor like Bless first, if you need to. Most likely the >> information you want is right at the start of the file. > > Parts of the data is inaccessible (very large parts in fact).The > structure is like that: > > Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> o = open("/home/toto/ae/00001.MPL", "r") >>>> oo = o.readlines() >>>> for listage, ligne in enumerate(oo): > ... print "Ligne n°", listage, ":", ligne > ... > Ligne n° 0 : MPLS0100:� > > Ligne n° 1 : �...@�`00005m2ts�x1�p> �1und > �und`00002M2TSp��> �1und �und`00003M2TSqu��> > �1und �und`00004M2T��> �1und > �und:�X��p��qu����J▒▒6PLEXDR▒�� � > > Ligne n° 2 : 2011. 1. 1 > > GH���� DD� : �T%d > > Ligne n° 4 : 2011. 1. 1T%dGH���� X&� > > Ligne n° 5 : 2011. 1. 1T%dGH����▒� > > Ligne n° 6 : 2011. 1. 1T%dGH���� > �▒▒ > > ����(����~�������������B�������~���"�����'о��� > �u���A���>���O��$mCy�C�N����g�����>�3�����...@f�^�,dW&#�Y�}n�����A�$▒�`��N0 > �d1A2 > > Ligne n° 7 : > > Ligne n° 8 : WGS-84 1GPSFRANCE > > ,dW&e n° 9 : FINISTÈRELOCMARIA-PLOUZANÉ---��N0 > �d1A2 > > Ligne n° 10 : > > Ligne n° 11 : WGS-84 1GPSFRANCE > > 5"A2e n° 12 : FINISTÈRELOCMARIA-PLOUZANÉ---��N0qdW*�d > > Ligne n° 13 : > > Ligne n° 14 : WGS-84 GPSFRANCE > > Ligne n° 15 : FINISTÈRE > 5"A2 PLOUGONVELINCENTRE AQUATIQUE TRÉZIROISE��N0qdW*�d > > Ligne n° 16 : > > Ligne n° 17 : WGS-84 GPSFRANCE > > Ligne n° 18 : FINISTÈRE > PLOUGONVELINCENTRE AQUATIQUE TRÉZIROISE� � > > ��DMC-TZ10�DMC-TZ10�DMC-TZ10�DMC-TZ10 > > > How to set up a hex editor ? > >> ~Corey Richardson > > a+ >
Open the file not with 'r' but with 'rb'. That opens the file as binary, not text. To use Bless, run sudo apt-get install bless on Ubuntu and variants, for Windows try HxD, http://mh-nexus.de/en/hxd/. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor