有没有人编写过人员代码来读取使用分号作为分隔符和逗号作为小数分隔符的 CSV 文件?
我需要阅读使用这些字符而不是普通逗号和小数点的意大利 CSV 文件。
你的经历是什么?有什么要注意的吗?
有没有人编写过人员代码来读取使用分号作为分隔符和逗号作为小数分隔符的 CSV 文件?
我需要阅读使用这些字符而不是普通逗号和小数点的意大利 CSV 文件。
你的经历是什么?有什么要注意的吗?
两种选择,一种使用文件布局,另一种不使用。
选项 A)使用文件布局:考虑文件布局的以下属性
value(&new_str)
在新字符串上使用以将其转换为数字选项 B) 没有文件布局:
&ret_arr = split(&str_line,";");
&ret_arr
数组将填充字段值,使用&ret_arr[1],..[2]
等访问它们。value(&new_str)
用于转换。以上是我的经验(很长一段时间),没有其他需要注意的。希望这可以帮助!
If you are using a file layout it probably won't read the commas in as decimal separator although you can tell it to use the semi-colon as the separator. Your other option is to read all fields in as text and then do a replace on the number fields to replace the comma with a period and then do a value() on the string to convert it to a number.