Import text files with extensions other than .txt
24 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Gollapalli Prince
am 27 Feb. 2021
Kommentiert: Star Strider
am 28 Feb. 2021
I have a text file shown below. The file has .vasp extension.
When I changed the extension to .txt, the file is opening by entering readtable('filename.txt'), could you please help me open this file without changing extension to .txt ?
Ti4 N4
1.0
4.2535338402 0.0000000000 0.0000000000
0.0000000000 4.2535338402 0.0000000000
0.0000000000 0.0000000000 4.2535338402
N Ti
4 4
Direct
0.000000000 0.000000000 0.500000000
0.500000000 0.000000000 0.000000000
0.000000000 0.500000000 0.000000000
0.500000000 0.500000000 0.500000000
0.000000000 0.000000000 0.000000000
0.000000000 0.500000000 0.500000000
0.500000000 0.000000000 0.500000000
0.500000000 0.500000000 0.000000000
0 Kommentare
Akzeptierte Antwort
Star Strider
am 27 Feb. 2021
One recent example from an earlier Answer:
opts = detectImportOptions('breast-cancer-wisconsin.data', 'FileType','text');
BCTable = readtable('breast-cancer-wisconsin.data', opts);
A similar approach should also work for your files.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!