Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
is it possible to load the content of $Field into a Table, e.g.
x:
load $FIELD autogenerate 1;
or similar?
thx - Marcel
Not 100% sure, but I believe the system fields like $Field will not be accessible prior script finished execution.
But you can access all field names loaded using the table functions in your script:
The table functions return information about previously loaded data tables.
Returns the name of the field with the specified number within a previously loaded table.
If the function is used within a load statement, it must not reference the table currently being loaded.
Examples:
LET a = FieldName(4,'tab1');
T1:
Load a, b, c, d from abc.csv
T2:
Load FieldName (2, 'T1') Autogenerate 1;
FieldNumber('field ' ,'TableName')
Returns the number of a specified field within a previously loaded table.
If the function is used within a load statement, it must not reference the table currently being loaded.
Examples:
LET a = FieldNumber('Customer','tab1');
T1:
Load a, b, c, d from abc.csv
T2:
Load FieldNumber ('b', 'T1') Autogenerate 1;
Returns the number of fields in a previously loaded table.
Examples:
LET a = NoOfFields('tab1');
Load *, NoOfFields( ) from abc.csv;
Returns the number of rows (records) in a previously loaded table.
If the function is used within a load statement, it must not reference the table currently being loaded.
Examples:
LET a = NoOfRows('tab1');
Load * from abc.csv where NoOfRows( )<30;
Returns the number of tables previously loaded.
Returns the name of the table with the specified number.
If the function is used within a load statement, it must not reference the table currently being loaded.
Returns the number of the specified table.
If the function is used within a load statement, it must not reference the table currently being loaded.
There are some examples here in the forum how to iterate over all tables, all field names, something like
FOR t = 0 TO NoOfTables() -1
LET vTableName = TableName(t);
// Loop through all fields/columns within the table
FOR vColumnCounter = 1 TO NoOfFields(vTableName)
LET vFieldName = FieldName(vColumnCounter, vTableName);
// DO SOMETHING
NEXT
NEXT