How should I import dataset separately from a long text file?
Afficher commentaires plus anciens
Hi,
I have a dataset like this (attached). Please let me know if there is a way to import all the "tables" individually as a separate dataset. Basically, the data loops start after the summary with a string "table x", then some parameters. After parameters the data starts with the variable names.
I also want to ignore the summary of the dataset at the beginning.
delimeter: tab
4 commentaires
Mathieu NOE
le 30 Mar 2022
hello
you need a dedicated parser for that , but a "real" data file would be more efficient to work with
all the best
Md Redwanul Islam
le 30 Mar 2022
Modifié(e) : Md Redwanul Islam
le 30 Mar 2022
Mathieu NOE
le 30 Mar 2022
hello again
to be sure, what you need is those tables ?
like
Time [s] V+ [V] V- [V] I1 [A] P1 [uC/cm2] I2 [A] P2 [uC/cm2] I3 [A] P3 [uC/cm2] D1 [nm] D2 [nm] D3 [nm] CH3 [V]
0.000000e+000 7.820238e-001 0.000000e+000 5.293780e-008 -4.931280e+001 5.293780e-008 -4.931280e+001 0.000000e+000 -2.672872e+001 0.000000e+000 0.000000e+000 0.000000e+000 0.000000e+000
2.500000e-004 2.778735e+000 0.000000e+000 5.542453e-008 -4.917735e+001 5.542453e-008 -4.917735e+001 0.000000e+000 -2.672872e+001 -2.207564e-003 -2.207564e-003 0.000000e+000 0.000000e+000
5.000000e-004 4.777116e+000 0.000000e+000 6.000530e-008 -4.903306e+001 6.000530e-008 -4.903306e+001 0.000000e+000 -2.672872e+001 -1.466427e-002 -1.466427e-002 0.000000e+000 0.000000e+000
7.500000e-004 6.777614e+000 0.000000e+000 6.009513e-008 -4.888294e+001 6.009513e-008 -4.888294e+001 0.000000e+000 -2.672872e+001 -1.587351e-002 -1.587351e-002 0.000000e+000 0.000000e+000
1.000000e-003 8.768961e+000 0.000000e+000 5.680956e-008 -4.873681e+001 5.680956e-008 -4.873681e+001 0.000000e+000 -2.672872e+001 -2.400754e-002 -2.400754e-002 0.000000e+000 0.000000e+000
1.250000e-003 1.077756e+001 0.000000e+000 5.808965e-008 -4.859318e+001 5.808965e-008 -4.859318e+001 0.000000e+000 -2.672872e+001 -3.077039e-002 -3.077039e-002 0.000000e+000 0.000000e+000
1.500000e-003 1.276941e+001 0.000000e+000 5.580522e-008 -4.845081e+001 5.580522e-008 -4.845081e+001 0.000000e+000 -2.672872e+001 -3.635528e-002 -3.635528e-002 0.000000e+000 0.000000e+000
1.750000e-003 1.476892e+001 0.000000e+000 6.166729e-008 -4.830397e+001 6.166729e-008 -4.830397e+001 0.000000e+000 -2.672872e+001 -3.822271e-002 -3.822271e-002 0.000000e+000 0.000000e+000
2.000000e-003 1.676584e+001 0.000000e+000 5.885770e-008 -4.815332e+001 5.885770e-008 -4.815332e+001 0.000000e+000 -2.672872e+001 -4.513578e-002 -4.513578e-002 0.000000e+000 0.000000e+000
2.250000e-003 1.876169e+001 0.000000e+000 5.659342e-008 -4.800900e+001 5.659342e-008 -4.800900e+001 0.000000e+000 -2.672872e+001 -4.782756e-002 -4.782756e-002 0.000000e+000 0.000000e+000
Md Redwanul Islam
le 31 Mar 2022
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!