Removing unrecognised characters and superfluous data from a string

32 Ansichten (letzte 30 Tage)
I have a set of data I have imported as a string, however when it is imported it fills in blank rows with arrow characters, as shown below:
NC(N)=N→59.0717→C→"5N3→-1.71840001642704→0.022000011056661606→75.89000129699707"→→→→→→→→→→→→"
"→→→→→→→→→→→→→"
"OC(=O)CCC(O)=O→118.08764→C4→"6O4→-0.6665999889373779→-0.4739999994635582→74.5999984741211"→→→→→→→→→→→→"
"→→→→→→→→→→→→→"
"CC(=O)NC1=CC=C(O)C=C1→151.16446→C8→"9NO2→1.0175999999046325→-1.6619999147951603→49.32999897003174"→→→→→→→→→→→→"
"→→→→→→→→→→→→→"
"NC(N)=N→59.0717→C→"5N3→-1.71840001642704→0.022000011056661606→75.89000129699707"→→→→→→→→→→→→"
"→→→→→→→→→→→→→"
I can't remove these by the method I would normally use below:
Data(Data == "→→→→→→→→→→→→→") = []
In the original file they appear to be blank lines, in between the actual lines of text.
Is there a way to remove these?
  11 Kommentare
Stephen23
Stephen23 am 16 Jul. 2019
@Duncan: the original file is an .xlsx file? If you actually copied that data from a website, can you please just give a link?
Duncan
Duncan am 17 Jul. 2019
@Stephen Cobeldick: I used this website to generate data from a set of data which I have also attached:

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Yueyan Li
Yueyan Li am 17 Jul. 2019
Bearbeitet: Yueyan Li am 17 Jul. 2019
That's not unrecognized data, it is tab, use sprintf('\t') to generate it.
please run:
replace(CrystalData(37),sprintf('\t'),'')

Weitere Antworten (0)

Produkte


Version

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by