How to export column data to string or txtI have the following data table, how can I export the column using JSL:
1. string = 561193, 542003, 527679...
2. export the data to .txt where the values show: 561193, 542003, 527679...
s
Data AccessRe: How to export column data to string or txt@txnelson thank you very much!
Re: How to export column data to string or txtNames Default To Here( 1 );
dt = Current Data Table( );
// Stop the script if no open data tables
If( Is Empty( dt ), Stop());
// Make list of column names
colNames = dt << get column names();
// Select the column
nw = New Window("Column names", <<MODAL></MODAL>Re: How to export column data to string or txt@txnelson ,thank you very much for reply. it really works.
I am new JSLer. I have to seek for your help here: How can I use the selected column to replace "dt:number" in following JSL?
Names Default To Here( 1 );
dt = Current Data Table( );
// Stop the script if no open data tables
If( Is Empty( dt ), Stop());
// Make list of column names
colNames = dt << get column names();
// Select the column
nw = New Window("Column names", <<MODAL></MODAL>
Re: How to export column data to string or txtHere is one way to do it
Names Default To Here( 1 );
// Create an example data table
dt = New Table( "Example",
add rows( 100 ),
New Column( "Number", character, set each value( Char( Random Integer( 1000, 9999 ) ) ) )
);
// Convert character column to a literal string value
string = Concat Items( dt:number[Index( 1, N Rows( dt ) )], "," );
// Write the string variable to a .txt file
Save Text File( "$TEMP/savedfile.txt", string );