extracting data from .ags file
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
jessupj
il 7 Dic 2023
Modificato: jessupj
il 7 Dic 2023
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.
Risposte (1)
Cris LaPierre
il 7 Dic 2023
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 Commenti
Vedere anche
Categorie
Scopri di più su Text Files in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!