reading a file...

Sandeep Avinash Gohad gohadbhai at rediffmail.com
Wed Oct 20 03:30:24 EDT 2004


An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20041020/8e899d4c/attachment.html>
-------------- next part --------------
  
Hello

I opened a file in a read mode

a=open('c:/a.bd4', 'r')
print a
a.read()

(This .bd4 format is not known for me.)
This gives the following output :

'\x08\x00BDF\x00\xef\xcb\x830\x8d\xa1\x07\x00\xf5\x00B1\x00\x003B\xf4\x01\x00\x00U\x0f\x04\x00SUF\x00\xef\xcb\x830\xf6\xa2\x07\x00!\x00B1\xcd\xac\x8eC\x9d\x1c\x00\x00\x8c\x00&\x00SDF\x00\xef\xcb\x830\xfd\xa2\x07\x00@\x00B133\x97A\x16\r\x00\x00[]\x07\x00SUF\x00\xef\xcb\x830\n\xa3\x07\x00A\x00B1\xcd\xccvD\x8c\x00\x00\x009\xec\x00\x00SDF\x00\xef\xcb\x830\x0f\xa3\x07\x00J\x00B1\xcd\xcc\x83B\xf4\x01\x00\x00\xe6h\x01\x00BUF\x00\xf0\xcb\x830\x14\xa3\x07\x00\x9e\x01B1\x9a\x99IA>\x05\x00\x00\xf5\'\t\x00SDF\x00\xf0\xcb\x830(\xa3\x07\x00\x18\x00B1f\xa6\xd5Cx\x00\x00\x00\xd1@\x03\x00SDF\x00\xf0\xcb\x830C\xa3\x07\x00L\x00B1\xcdL\xb1C0\x01\x00\x00\xa6\xd2\x02\x00SDF\x00\xf0\xcb\x830\x8c\xa3\x07\x00t\x00B1\x00\x00(C?\x07\x00\x00\xd0B\x04\x00BDF\x00\xf0\xcb\x830\x96\xa3\x07\x00G\x01B1\x00\x00\xc8A\xb6\x03\x00\x00\xce\xa1\x0b\x00BUF\x00\xf0\xcb\x830\x94\xa1\x07\x00K\x00B1f\xe

so i can not read that file,according to me the data is in the hexadecimal format
please tell me how to read this data and convert it into long datatype
and then copy the data and save it into .csv file.

please guide me...

Regards
sandeep


In this program



More information about the Python-list mailing list