Ask Your Question

# Revision history [back]

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.

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
291291


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)
291ZZ('0x'+s)
291


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