Zahira Melendez Posted September 6, 2014 Share Posted September 6, 2014 Add Row to Table in Python I have an existing table with several rows on it. I want the script to add a row which contain values that the script is generating.I can see that the row is added but new columns are added as well. I want the row to add the values using the existing columns. Here is what I have:rowData = "08/30/2014t" + Convert.ToString(timeRemaining) + "ttt" + Convert.ToString(manInProject) + "t" + Convert.ToString(multiplier) + "tt0rn" # Make a stream from the stringstream = MemoryStream()writer = StreamWriter(stream)writer.Write(rowData)writer.Flush()stream.Seek(0, SeekOrigin.Begin) # Set up the text data reader# The name of these are the same as the existing columnsreaderSettings = TextDataReaderSettings()readerSettings.Separator = "t"readerSettings.SetColumnName(0,"Date")readerSettings.SetColumnName(1,"Man Mins Remaining (from JIRA)")readerSettings.SetColumnName(2,"Task Days Remaining")readerSettings.SetColumnName(3,"Workdays remaining")readerSettings.SetColumnName(4,"Man in Project")readerSettings.SetColumnName(5,"Multiplier")readerSettings.SetColumnName(6,"Column 7")readerSettings.SetColumnName(7,"Man Days Available") table = Document.Data.Tables[tableName]# Create a data source to read in the streamtextDataSource = TextFileDataSource(stream, readerSettings) #Also tried sending the stream ONLY but it still didn't work # Add rowrowSettings = AddRowsSettings(table, textDataSource)table.AddRows(textDataSource, rowSettings) Link to comment Share on other sites More sharing options...
David Pesante 4 Posted October 23, 2015 Share Posted October 23, 2015 Did you ever figured out how to do this Link to comment Share on other sites More sharing options...
Norbert Ledenyi Posted October 23, 2015 Share Posted October 23, 2015 Sorry that I can't provide the solution, but I'm also curious to see how it can be achieved, so I'm leaving a comment here just so I get a notification if someone comments :) Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted October 23, 2015 Share Posted October 23, 2015 Did anyone find a solution to this problem I countered this problem only with some data files, not all. I am curious what might be causing this problem as all my data files look very similar. Link to comment Share on other sites More sharing options...
Kirsten Gustafson 2 Posted June 16, 2019 Share Posted June 16, 2019 An example is now available here, for anyone that may come across this thread in the future: https://community.spotfire.com/wiki/how-append-new-rows-existing-data-table-tibco-spotfirer-using-ironpython-scripting 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