MartinKoch123 / yaml

MATLAB YAML parser and emitter based on SnakeYAML
MIT License
22 stars 7 forks source link

How do I parse this .yml format file? #4

Closed cuixing158 closed 2 years ago

cuixing158 commented 2 years ago

hi, I need to parse such a .yml file into matlab, or later I need to save the variables in matlab in similar .yml format, but I can't import and export successfully, I expect the author to enhance this function!

s = yaml.loadFile("cam_proj_CAM_FRONT.yml");

The output error message is as follows:

Error using yaml.load
Failed to load YAML string.
Error in yaml.loadFile (line 44)
result = yaml.load(content, "ConvertToArray", options.ConvertToArray);
Caused by:
    Error using yaml.load
...

cam_proj_CAM_FRONT.zip

Link to question information

MartinKoch123 commented 2 years ago

Hey, Im sorry you are having trouble with the tool. I wont be able to investige the issue until next week. Maybe you can try and see if you can read subparts of the file until I can fix it.

MartinKoch123 commented 2 years ago

Hi @cuixing158 , there are two problems:

You can build a workaround like this:

To write YAML files in the same format you have to reverse the above process. However, it will not be formatted such that every row is in a new line.