2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
Let's write something simpler, intercept the string, and use csv for parameterized files. Then open it with excel. If it is a number, the format is easily messed up. Some colleagues use double quotes to enclose the number, and no quotes are needed in the message, but it seems easy to mess up when beanshell is processed in this way, because variables also use quotes. I changed it to add a semicolon in front of the number, and remove the semicolon in front after reading the parameter.
We won’t use CSV here, but will use user parameters directly, pretending that they are parameters obtained by reading CSV.
No=vars.get("No");
log.info("No obtained: "+No);
No=No.substring(1);
log.info("remove the No after the first digit: "+No);
The above directly removes the first digit. If you want to take out 002, the same is true.
No=vars.get("No");
log.info("No obtained: "+No);
No=No.substring(1);
log.info("remove the No after the first digit: "+No);
No1=No.substring(0,3);
log.info("Intercepted 001: "+No1);
This truncation specifies the number of digits, and we will only use these for now.