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