<% meth="excel_to_tabular" %>

<div class="lvl1">

	<p> Convert table from excel to plain format (CSV, TSV and similar). </p>
	<h3> Basic example </h3>

		<p> This example shows how to convert a table from excel to plain format (CSV, TSV and similar). The two-sheet excel file is as follows:</p>
		<div class="row">
			<div class="col-md-6">
				${plotter.embed_img("./special_files/hoja1.png")}
			</div>
			<div class="col-md-6">
				${plotter.embed_img("./special_files/hoja2.png")}
			</div>
		</div>

		<%
			table_name = 'scRNAseq.xlsx'
			args = f"-i special_files/{table_name} --file_type excel --excel_cols 1,2,3 --excel_sheet_number 1"
		%>

		<p> Let's extract the first three columns from the first sheet of the file ${f"special_files/{table_name}"} and convert it to plain tabular format. 
		We will use the -i flag to specify input file, -c to select columns to extract and -s for the sheet to retrieve data from.<p>
		
		${show_n_exec(table_name, args, "cmdtabs", skip_input=True)}

	<h3> Extracting the first two and last two columns from the second sheet</h3>
		<p> In this case, we extract the first two and last two columns from the second sheet in the same file </p>
		<%
			args = f"-i special_files/{table_name} --file_type excel --excel_cols 1-2,4-5 --excel_sheet_number 2"
		%>
		${show_n_exec(table_name, args, "cmdtabs", skip_input=True)}

	<h3> Extract all columns from the first sheet </h3>
		<p> If we wish to extract all columns without specifying all of them we can just leave the --excel_cols argument empty, which signals for the extraction of every column. </p>
		<%
			args = f"-i special_files/{table_name} --file_type excel --excel_sheet_number 1"
		%>
		${show_n_exec(table_name, args, "cmdtabs", skip_input=True)}


	<h3> Extracting select rows</h3>
		<p> In addition to columns, the user can also choose which rows to extract from the table. By default, every row is extracted, but we can extract a selection. </p>
		<p> In this case we are extracting rows 1,3 and columns 1,3,4 from the first sheet</p>
		<%
			args = f"-i special_files/{table_name} --file_type excel --excel_rows 1,3 --excel_cols 1,3,4 --excel_sheet_number 1"
		%>
		${show_n_exec(table_name, args, "cmdtabs", skip_input=True)}

</div>