How to concatenate files and preserve formula columnsI'd like to concatenate a main file withe a new file. The main file contains a formula column, the new file not. The resulting file should have the formula column with the formula from the main file.
Additional the new file should be renamed to the name of of main file and the the former main file and the new file should be closed and not saved.
Re: How to concatenate files and preserve formula columnsThanks Jeff. The append to ... command makes it even better.
Re: How to concatenate files and preserve formula columnsThanks Jim. That's what I was looking for.
Re: How to concatenate files and preserve formula columnsTo avoid the creation of a new data table and having to deal with renaming you can use the Append to first table option.
Names Default To Here( 1 );
dtMain = Data Table( "MainFile" );
dtNew = Data Table( "NewFile" );
dtConcat = dtMain << Concatenate( dtNew, Append to first table, Keep Formulas );
Re: How to concatenate files and preserve formula columnsThanks txNelson for this useful post. I was just working on the exact same issue , and the "keep formulas" parameter solves my problem.
Re: How to concatenate files and preserve formula columnsThe main part of the JSL below, was obtained by running the Concatenate platform interactively to get what was desired, and then taking the JSL from the Source of the new table and pasting it into the script.
Names Default To Here( 1 );
dtMain = Data Table( "MainFile" );
dtNew = Data Table( "NewFile" );
dtConcat = dtMain << Concatenate( dtNew, Keep Formulas );
concatName = dtMain << get name;
Close( dtMain, nosave );
Close( dtNew, nosave );
dtConcat << set name( concatName );