read data formatted like ip address from a text file
Mostrar comentarios más antiguos
I want to read a file formatted like this :
256.13.34.14: 257.13.34.15 221.18.87.18 266.13.77.19
257.13.34.15: 256.13.34.14 221.18.87.18
into a matrix like this:
256.13.34.14 257.13.34.15 221.18.87.18 266.13.77.19
257.13.34.15 256.13.34.14 221.18.87.18 0
5 comentarios
Bob Thompson
el 28 de Mzo. de 2018
Have you tried dlmread()? I know you can set the delimiter to be the space, ' ', between the different IPs. You'll need to make sure the rest is read in as a string, but it should work.
Of course, now I'm questioning myself on whether dlmread() can bring in strings, but I know txtread can have specified delimiters as well.
Hessa saad
el 28 de Mzo. de 2018
per isakson
el 28 de Mzo. de 2018
"into a matrix like this:" Do you mean character array?
Elias Gule
el 28 de Mzo. de 2018
do you want to the data in string format or do you want it converted to double? This is very important in that it to a degree dictates the type of storage used for the data.
Hessa saad
el 28 de Mzo. de 2018
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Text Files en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!