Sundaram Sridharan Posted June 2, 2022 Share Posted June 2, 2022 I need to read in a CSV/TXT file and change data types using ironpython. The TextReaderSettings class has one method called SetDataType and looks like readersettings.SetDataType(0,DataType.Integer) let's say I have 5 columns and I made guesses as to what the data types are (by reading a few rows) - I have put the data types in a list: list = ["Integer","String","Real",....] is there a way to set up a loop to assign data types using this list if I try something like dType = "DataType."+list[0] and then try readersettings.SetDataType(0,dType) it gives me error as it expects a data type as second argument whereas I am giving it a string. How do I implement this are there other ways of forcing spotfire to guess data types automatically through IronPython Link to comment Share on other sites More sharing options...
Sundaram Sridharan Posted June 2, 2022 Author Share Posted June 2, 2022 I am answering my own question - I added the readersettings statement right inside the loop where I figure out data typs of different columns Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now