Hel*_*lbo 3 csv parsing text smalltalk pharo
我想解析Pharo Smalltalk中的文本文件,它具有下面概述的结构,称为TestResults的Smalltalk对象,它包含所有数据元素的实例变量:
Properties:
Name: Value
Name: Value
...
Settings:
Category
SubCategory
Name=Value
SubCategory
Name=Value
Name=Value
...
Column1 Column2 Column3 ...
Value Value Value...
...
Run Code Online (Sandbox Code Playgroud)
我考虑过将NeoCSV用于文件末尾的制表符分隔值部分,但我不知道如何解析文件的开头以及如何将它(如果可行的话)与NeoCSV结合起来.
我建议你看看PetitParser.请参阅http://pharobooks.gforge.inria.fr/PharoByExampleTwo-Eng/latest/PetitParser.pdf和http://www.themoosebook.org/book/internals/petit-parser.如果您需要编写解析器的帮助,请不要犹豫,就stackoverflow创建更多问题.