Hello,
Is there an option in JSL to read in the first two lines of a text file as a column header or
alternatively (and even better) the first as Column name and the second as the column property (Units)
Thank you
Mirko

@martindemel
Multiple File Import can do it, even for a single file.

Craige's example below is a better solution, but this code might also be useful.
Here is a little script that does the conversion you want
Names Default To Here( 1 );
dt = Open(
"<PATH to="" bsp_jmp.txt="">",
columns(
New Column( "YYYY", Numeric, "Continuous", Format( "Best", 12 ) ),
New Column( "MM/DD", Character, "Nominal" ),
New Column( "DAY", Character, "Nominal" ),
New Column( "hh:mm:ss", Numeric, "Continuous", Format( "h:m:s", 11, 0 ), Input Format( "h:m:s", 0 ) )
)
);
// Add 2nd line text to Column Name
For( i = 1, i <= N Cols( dt ), i++,
If( Column( dt, i ) << get data type == "Character" & Column( dt, i )[1] != "",
Column( dt, i ) << set name( Column( dt, i ) << get name || Column( dt, i )[1] )
)
);
// Delete second name row
dt << delete rows(1);
// Convert columns that are character but should be numeric, to numeric
For( i = 1, i <= N Cols( dt ), i++,
If( Column( dt, i ) << get data type == "Character" & Is Missing( Num( Column( dt, i )[1] ) ) != 1,
Column( dt, i ) << set data type( Numeric ) << set modeling type( Continuous )
)
);</PATH>

Thank you very much for the support.
I prefer this JSL solution.
The multiple file import works fine too but adds an “_” to the header name.

dtlist = Multiple File Import(
<<SET folder="">"; // make part of name
);
, // only one part? still need the rename to remove the trailing _
newname = p1
);
c << setname( newname );
);</SET>

You could use the multiple file import to do the import and use then a script to replace the "_" between the header lines in the column names with whatever you like. Just an idea.