Closed figo361 closed 1 year ago
this kind of name how to get value ,in rust struct name can't have / this symbol。
Can you provide me with an example? (a file and a simple failing test?) I believe it should read the proper encoding.
e yes ,i found a new way to get this data ,my way is define a struct to accept excel data with its title,so i open the excel and then rename its titile name to get its data ,but i meet a new error
this kind of code is not success ,why This style of writing is not supported
this style is support ,but its not graceful
What do you want do? If you want to compare cell and your values, you should use:
if Some(&DataType::String(s)) == range.get_value((0, 0)) {
println!("123")
}
Not if let
. In your last example, you copy value of cell (0, 25)
to title
.
let range = Range::from_sparse(vec![Cell::new((0, 0), String("A".to_string()))]);
let title = "B".to_string();
if let Some(DataType::String(title)) = range.get_value((0, 0)) {
println!("{}", title); // A
}
Thank you, I don't want to copy the value of title. I want to change the value of title because it has a special symbol /
oh ,sorry i means is header
thanks ! it work like this .
if Some(&DataType::String(
"医疗器械注册人/备案人英文名称".to_string(),
)) == range.get((0, 25))
{
range.set_value(
(0, 25),
DataType::String("医疗器械注册人_备案人英文名称".to_string()),
);
};