Hi,
I have the following script where I am opening two data tables which I need to process before using it for analysis. One of the data sets requires transposing from column 3 (:Inoculum ...) to the end of the table column 16 (Positive control leak-test) as shown below. However, I would like to make run automatic as the names are irrelevant but the table structure is always the same. Could anyone provide some feedback please on how to make it run? Thanks
dt1 = Open(
"C:\Users\ioliveira\Desktop\data\DEF-BMP Curves.csv",
columns(
New Column( "Sample", Character, "Nominal" ),
New Column( "Hour", Numeric, "Continuous", Format( "Best", 12 ) ),
New Column( "Average", Numeric, "Continuous", Format( "Best", 12 ) ),
New Column( "Minimum", Numeric, "Continuous", Format( "Best", 12 ) ),
New Column( "Maximum", Numeric, "Continuous", Format( "Best", 12 ) )
),
Import Settings(
End Of Line( CRLF, CR, LF ),
End Of Field( Comma, CSV( 0 ) ),
Strip Quotes( 1 ),
Use Apostrophe as Quotation Mark( 0 ),
Use Regional Settings( 0 ),
Scan Whole File( 1 ),
Treat empty columns as numeric( 0 ),
CompressNumericColumns( 0 ),
CompressCharacterColumns( 0 ),
CompressAllowListCheck( 0 ),
Labels( 1 ),
Column Names Start( 1 ),
Data Starts( 2 ),
Lines To Read( "All" ),
Year Rule( "20xx" )
)
);
dt2 = Open(
"C:\Users\ioliveira\Desktop\data\DM for BMP 31.07.18.xlsx",
Worksheets( "Protocol" ),
Use for all sheets( 0 ),
Concatenate Worksheets( 0 ),
Create Concatenation Column( 0 ),
Worksheet Settings(
1,
Has Column Headers( 1 ),
Number of Rows in Headers( 1 ),
Headers Start on Row( 3 ),
Data Starts on Row( 4 ),
Data Starts on Column( 1 ),
Data Ends on Row( 6 ),
Data Ends on Column( 16 ),
Replicated Spanned Rows( 1 ),
Replicated Spanned Headers( 0 ),
Suppress Hidden Rows( 1 ),
Suppress Hidden Columns( 1 ),
Suppress Empty Columns( 1 ),
Treat as Hierarchy( 0 ),
Multiple Series Stack( 0 ),
Import Cell Colors( 0 ),
Limit Column Detect( 0 ),
Column Separator String( "-" )
)
);
dt2 << Transpose(
columns(
:Inoculum,
:Positive Control,
:Name( "FB Powder 2/5 1.05.18" ),
:Economizer WEL 6.7 bar 15.05.18,
:Chicken muck black REL 08.05.18,
:Chicken muck white REL 08.05.18,
:Name( "Rye Ag-Bag EEL" ),
:M301,
:M302,
:M303,
:Name( "WEL ECON 24/7" ),
:Name( "WEL STRAW 24/7" ),
:Name( "WEL STRAW 20/6" ),
:Name( "Positive Control Leak-Test" )
),
Label( :Sample name ),
Output Table( "dt3" )
);