map first field to second field in txt file
Ältere Kommentare anzeigen
hi,
I have this txt file :
1::Toy Story (1995) ::Animation|Children's|Comedy
2::Jumanji (1995) ::Adventure|Children's|Fantasy
8::Tom and Huck (1995) ::Adventure|Children's
I want to map for example 1 into animation, and 2 into adventure 8 into adventure i.e ,i need creat txtfile has two columns , the first column contains 1,2,8 and second column contains animation,adventure,adventure
please, how do that thanks in advance
Akzeptierte Antwort
Weitere Antworten (1)
huda nawaf
am 4 Aug. 2012
Bearbeitet: Walter Roberson
am 4 Aug. 2012
3 Kommentare
Walter Roberson
am 4 Aug. 2012
textscan() will not work for this, at least not as-is. You can read the file (such as by using fileread() ) and then use regexp() to parse it.
per isakson
am 4 Aug. 2012
Bearbeitet: per isakson
am 4 Aug. 2012
See my answer above. I hope the lines you don't show don't contain "¤".
huda nawaf
am 5 Aug. 2012
Kategorien
Mehr zu Text Files finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!