<% "cmdtabs" %>
<div class="lvl1">

	<p> Extract a selection of columns from the original table </p>
	<h3> Basic example using numeric indices to select columns </h3>
		<p> Input table is provided with flag -i. Columns to extract are selected with flag -c (comma-separated 1-based numeric indices), using a hyphen (-) so select a column range. </p>
		<p> In this case, we will extract columns 1, 3, 4 and 5. We will do so by selecting column 1 and the 3-5 interval. </p>
		<%
			table_name = 'simple_table'
			args = f"-i tables/{table_name} --extract_cols 1,3-5"
		%>
		${show_n_exec(table_name, args, "cmdtabs")}

	<h3> Using column names if header flag is present </h3>
		<p> If flag -H is active, it means the table has a header. If that is the case we can select columns by specifying their name, again selecting multiple by separating them by commas.
		(NOTE: even if the table has a header, columns may be selected by numerical index without activating the -H flag, exactly as in the previous example) </p>
		<p> In this case, we will select columns col-1, col-3, col-4 and col-5, the same as in the previous example, but this time selecting them by column name.
		In this case it is also possible to select a range of columns, but in this case by using the "%-%" sequence of characters (as the hyphen may also be a part of the column name, as was chosen for this example) </p>
		<%
			table_name = 'simple_table'
			args = f"-i tables/{table_name} -H --extract_cols col-1,col-3%-%col-5"
		%>
		${show_n_exec(table_name, args, "cmdtabs")}
</div>