extracting data from .ags file
13 次查看(过去 30 天)
显示 更早的评论
I am looking to get data from .ags files (a kind of text file). The data is in different blocks with enters seperating those blocks and all blocks represent tables with the first line as the name and the rest in table format with commas seperating columns.
Which function and import options could I use to get the seperate tables? I just need a way to start, as I tried using readtable, textscan and the import data button, which doesnt show the file as an option. I also used readlines, that did give me all the lines in seperate cells as strings, but I was not able to create the tables. I added a small part of the data to show how it looks.
3 个评论
jessupj
2023-12-7
编辑:jessupj
2023-12-7
long ago, i had written a script to convert *.ags geotech files with specfic content to csv but i'd used the system shell tools (e.g. awk, sed, etc).
If i had to do it all over again, i'd check
and see if i could use the Bentley ags --> csv converter, and then readtable from within matlab.
回答(1 个)
Cris LaPierre
2023-12-7
Not pretty, but here's a quick and dirty template you can use to import AGS files. Since it appears the number of tables in the file can vary, I return the tables in a structure. If you prefer each table be a separate workspace variable, you can uncomment the assignin line of code on line 70.
Again, this is only meant to help get started. It is not extensively tested.
unzip('Show data.zip')
agsS = loadAGS('Show data.ags')
agsS.SCDT
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!