|
|
|
@ -24,7 +24,7 @@ pub fn xlsxtocsv(args: &Arguments) -> Result<(), Error> {
|
|
|
|
|
|
|
|
|
|
|
|
let (num_cols, num_rows) = sheet.get_highest_column_and_row();
|
|
|
|
let (num_cols, num_rows) = sheet.get_highest_column_and_row();
|
|
|
|
|
|
|
|
|
|
|
|
for i in 1..=num_rows {
|
|
|
|
for i in 0..num_rows {
|
|
|
|
if !args.include_hidden_lines {
|
|
|
|
if !args.include_hidden_lines {
|
|
|
|
match sheet.get_row_dimension(&i) {
|
|
|
|
match sheet.get_row_dimension(&i) {
|
|
|
|
Some(dim) => {
|
|
|
|
Some(dim) => {
|
|
|
|
@ -35,16 +35,19 @@ pub fn xlsxtocsv(args: &Arguments) -> Result<(), Error> {
|
|
|
|
None => continue,
|
|
|
|
None => continue,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let row = sheet.get_collection_by_row(&i);
|
|
|
|
|
|
|
|
let row_len = row.len();
|
|
|
|
|
|
|
|
let mut first = true;
|
|
|
|
let mut first = true;
|
|
|
|
for cell in row {
|
|
|
|
for j in 1..=num_cols {
|
|
|
|
if first {
|
|
|
|
if first {
|
|
|
|
first = false;
|
|
|
|
first = false;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
print!("{}", args.separator);
|
|
|
|
print!("{}", args.separator);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let cell = match sheet.get_cell((j, i)) {
|
|
|
|
|
|
|
|
Some(cell) => cell,
|
|
|
|
|
|
|
|
None => continue,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
let cell_coordinate = cell.get_coordinate();
|
|
|
|
let cell_coordinate = cell.get_coordinate();
|
|
|
|
let mut value;
|
|
|
|
let mut value;
|
|
|
|
if let Some((col, row)) = merged_cells.in_merged_cell(
|
|
|
|
if let Some((col, row)) = merged_cells.in_merged_cell(
|
|
|
|
@ -74,9 +77,6 @@ pub fn xlsxtocsv(args: &Arguments) -> Result<(), Error> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print!("{}", value);
|
|
|
|
print!("{}", value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for _ in row_len..num_cols as usize {
|
|
|
|
|
|
|
|
print!("{}", args.separator);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
println!("");
|
|
|
|
println!("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|