- #1
nenyan
- 67
- 0
reading data from txt files
there are two .txt files. One is map.txt, another is event.txt.
map looks like below:
dfafdafskdjf:{{0.837711763427 -0.8359730469 2.4152891949e-04 0.000360245716236} {0.831761777387 -0.8240730748 2.4446745066e-04 0.000359914513716} {0.819861805217 -0.8062231165 2.4910805126e-04 0.000359863615611}} klsajlkf
What I need are data in {}, omited the begging srting and the endding string.
event.txt:
PGC | Name | RA | Dec | Type | App_Mag | Maj_Diam (a) | err_Maj_Diam | Min_Diam (b) | err_Min_Diam | b/a | err_b/a | PA | Abs_Mag | Dist | err_Dist | err_App_Mag | err_Abs_Mag |
2|UGC12889|0.00047|47.27450|3.1|13.31|1.546|0.498|1.314|~|0.85|0.100|~|-21.05|72.458|10.869|0.61|0.61|
4|PGC000004|0.00096|23.08764|5.0|15.39|0.851|0.078|0.186|~|0.219|0.015|~|-18.68|63.264|13.918|0.39|0.40|
...
...
How to read these two files by mathematica? Thanks.
there are two .txt files. One is map.txt, another is event.txt.
map looks like below:
dfafdafskdjf:{{0.837711763427 -0.8359730469 2.4152891949e-04 0.000360245716236} {0.831761777387 -0.8240730748 2.4446745066e-04 0.000359914513716} {0.819861805217 -0.8062231165 2.4910805126e-04 0.000359863615611}} klsajlkf
What I need are data in {}, omited the begging srting and the endding string.
event.txt:
PGC | Name | RA | Dec | Type | App_Mag | Maj_Diam (a) | err_Maj_Diam | Min_Diam (b) | err_Min_Diam | b/a | err_b/a | PA | Abs_Mag | Dist | err_Dist | err_App_Mag | err_Abs_Mag |
2|UGC12889|0.00047|47.27450|3.1|13.31|1.546|0.498|1.314|~|0.85|0.100|~|-21.05|72.458|10.869|0.61|0.61|
4|PGC000004|0.00096|23.08764|5.0|15.39|0.851|0.078|0.186|~|0.219|0.015|~|-18.68|63.264|13.918|0.39|0.40|
...
...
How to read these two files by mathematica? Thanks.