> Hi All. > > I have a list which is a line from a file: > ['\x003\x008\x001\x004\x007\x005\x00.\x005\x000\x002\x005\x009 > \x009\x00', > '\x002\x001\x003\x006\x002\x002\x00.\x001\x007\x004\x002\x008\ > x002\x00'] > > This should be in the format: > ['381475.502599', '213622.174282'] > > I've tried a few options using replace (replacing "\x00" with "") and > trying to convert from hexademical to decimal. > > But nothing has worked. Can anybody give any tips to help? > > Thanks.
Somthing like: line = ['\x003\x008\x001\x004\x007\x005\x00.\x005\x000\x002\x005\x009\x009\x00' , '\x002\x001\x003\x006\x002\x002\x00.\x001\x007\x004\x002\x008\x002\x00'] result = [''.join(x.split('\x00')) for x in line] Cheers, Drea -- http://mail.python.org/mailman/listinfo/python-list