help to convert text file symbol into array

1 visualización (últimos 30 días)
Furat Alobaidy
Furat Alobaidy el 20 de Ag. de 2019
Respondida: Furat Alobaidy el 20 de Ag. de 2019
Hi i have this text file :
4c07b] IF hit state: 5 (S) valid: 1 writable: 0 readable: 1 dirty: 0 tag: 260
243240500: system.cpu00.icache: ReadReq [4c078c:4c078f] IF hit state: 5 (S) valid: 1 writable: 0 readable: 1 dirty: 0 tag: 260
243241000: system.cpu00.icache: ReadReq [4c0780:4c0783] IF hit state: 5 (S) valid: 1 writable: 0 readable: 1 dirty: 0 tag: 260
How convert each symbole in row into array ?
for example :
4c07b] IF ==== 4 = i[1,1]
c=i[1,2]
0= i[1,3]
7= [1,4]
b=i[1,5]
] =i[1,6]
....m

Respuesta aceptada

Stephan
Stephan el 20 de Ag. de 2019
Assuming you import this as a string, you could use:
a = "4c07b] IF hit state: 5 (S) valid:"
b = char(a)
c = b(:)
which gives:
c =
33×1 char array
'4'
'c'
'0'
'7'
'b'
']'
' '
'I'
'F'
' '
'h'
'i'
't'
' '
's'
't'
'a'
't'
'e'
':'
' '
'5'
' '
'('
'S'
')'
' '
'v'
'a'
'l'
'i'
'd'
':'

Más respuestas (1)

Furat Alobaidy
Furat Alobaidy el 20 de Ag. de 2019
Thanks a lot for helping.

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by