Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can deal with .csv files by importing the csv module.

Hexadecimals are represented by numbers starting with 0x:

sage: 0x100 256 sage: 0x123 291

To transform an hexadecimal string representation of a number a to a Sage integer (that can be very long), you can do:

sage: a = '123' sage: ZZ('0x'+a) 291

If you need more informations, you should provide a sample of your csv file and the result you would expect.

click to hide/show revision 2
No.2 Revision

You can deal with .csv files by importing the csv module.

Hexadecimals are represented by numbers starting with 0x, see this page :

sage: 0x100
256
sage: 0x123
291

291

To transform an hexadecimal string representation s of a number a to a Sage integer (that can be very long), you can do:

sage: a s = '123'
sage: ZZ('0x'+a)
291

ZZ('0x'+s) 291

If you need more informations, you should provide a sample of your csv file and the result you would expect.