Alex Weir 2 Posted June 29, 2023 Share Posted June 29, 2023 # Seems by default SAS description is applied as column names in the script belowfrom Spotfire.Dxp.Data import *from Spotfire.Dxp.Data.DataOperations import *from Spotfire.Dxp.Data import DataFlowBuilderfrom Spotfire.Dxp.Application import DocumentMetadatafrom Spotfire.Dxp.Data.DataOperations import DataOperationfrom Spotfire.Dxp.Application.Visuals import HtmlTextAreafrom Spotfire.Dxp.Framework.Library import LibraryManager, LibraryItemType, LibraryItem, LibraryItemRetrievalOptionlm = Application.GetService(LibraryManager)from System import Guidfor tbl in Document.Data.Tables: sourceView = tbl.GenerateSourceView(); try: op=sourceView.GetAllOperations[DataSourceOperation]()[0] except: pass; if type(op).__name__ == 'DataSourceOperation': t=op.GetDataFlow().DataSource try: if (t.FilePath == None): path="Clipboard" else: path=t.FilePath print path updatedPath = path.replace("import\","import\Migration_Test\") dataSource= Document.Data.CreateFileDataSource(updatedPath) dataFlow = DataFlowBuilder(dataSource, Application.ImportContext).Build() if op.CanReplaceDataFlow(): op.ReplaceDataFlow(dataFlow) except: print "NA"; 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