I want to use Import to create a dataset that drops the first row (“File generated automatically by software”), contains the second row as headers, imports only the 4th to 7th rows, and only the 2nd and 3rd columns.
I need help with specifying the columns to be imported.
What I have now is
Import[
"myfile.xlsx",
{"XLSX", "Dataset", "Sheet1" ,
2 ;; (*drops the first row*)},
HeaderLines -> 1
]
which gives all columns and all rows except of the first. I then manipulate it to create a new variable that has only the rows and columns I need.
But I am looking for a way to achieve this only using Import.
My question is about specyfying rows to be imported.
Can I import only row 2 (which will be used as a header) and rows 4 to 7?
Something like
Import["data.xlsx", {
"Dataset",
1,(*in sheet no. 1*)
{2, 5 ;; 7},(*import row 2 and rows 4 to 7*)
2 ;; 3}, (*import only 2nd and 3rd columns *)
"SkipLines" ->
1, (*skip the message automatically generated by software*)
HeaderLines -> 1 (*use current and voltage as headers*)
]