Fixed Columns
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -41,10 +41,10 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
let year = datestring[0..4].parse::<i64>().unwrap();
|
||||
let month = datestring[5..].parse::<i64>().unwrap();
|
||||
data_vec.push(Data {
|
||||
description: String::from(row[45].get_string().unwrap()),
|
||||
sku: String::from(row[34].get_string().unwrap()),
|
||||
level2: String::from(row[30].get_string().unwrap()),
|
||||
level3: String::from(row[31].get_string().unwrap()),
|
||||
description: String::from(row[46].get_string().unwrap().replace("\"", "")),
|
||||
sku: String::from(row[35].get_string().unwrap()),
|
||||
level2: String::from(row[31].get_string().unwrap()),
|
||||
level3: String::from(row[32].get_string().unwrap()),
|
||||
revenue: match row[76].get_float() {
|
||||
Some(x) => x,
|
||||
None => match row[76].get_int() {
|
||||
@@ -61,7 +61,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
},
|
||||
quantity: match row[75].get_int() {
|
||||
Some(x) => x,
|
||||
None => match row[76].get_float() {
|
||||
None => match row[75].get_float() {
|
||||
Some(x) => x as i64,
|
||||
None => 0,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user