我正在尝试将数据从 Isam 文件中分离出来,使用 fgets 和 substr 逐行循环以从行的正确位置获取正确的数据。
源数据:
000000124325424Productname Type Price Weight Unit Unitcode
000000124325324Productname2 Type2 Price2 Weight2 Unit2 Unitcode2
问题是 substr 无法识别数据之间的那些额外空格,因此数据的位置每行都在变化。
Substr 是这样“看到”的行:
000000124325424Productname Type Price Weight Unit Unitcode
有什么办法可以保留项目之间的空间?