| 
 | 
  
	
		 | 
		Specific String aus Textfile | 
		 | 
	 
 
 
| Hai123 | 
 
  
 
Forum-Anfänger
 
 
 | 
 
  | 
Beiträge: 16
 | 
  | 
 
 | 
 
  | 
Anmeldedatum: 29.04.16
 | 
  | 
 
 | 
 
  | 
Wohnort: ---
 | 
  | 
 
 | 
 
  | 
Version: ---
 | 
  | 
 
 | 
 
 
 | 
 
  | 
 
  | 
      
Verfasst am: 19.06.2019, 11:51    
Titel: Specific String aus Textfile
 | 
  | 
 
 
|   | 
  | 
           | 
 
 
Hallo Leute,
 
 
ich möchte gerne aus einem Textfile mehrere Zeilen auslesen.
 
Habe bis jetzt schon mal textscan() verwendet, komme jedoch auf keinen grünen Zweig.
 
 
Mein Textfile sieht folgendermaßen aus : 
 
 
-----------------------------------------------------------------
 
RDBSniffer::printMessage: ---- full info ----- BEGIN
 
  message: version = 0x011f, simTime = 117.283, simFrame = 7038, headerSize = 24, dataSize = 8276
 
    entry: pkgId =  7 (RDB_PKG_ID_ROADMARK), headersize = 16, dataSize = 5604, elementSize = 1868, noElements = 3, flags = 0x0
 
      playerId     = 1
 
      id           = 0
 
      prevId       = -1
 
      nextId       = -1
 
      lateralDist  = 1.730
 
      yawRel       = 0.005
 
      curvHor      = 0.012226
 
      curvHorDot   = -0.000000
 
      startDx      = 0.000
 
      previewDx    = 100.000
 
      width        = 0.130
 
      height       = 0.020
 
      curvVert     = -0.000000
 
      curvVertDot  = 0.000000
 
      type         = 2
 
      color        = 1
 
      roadId       = 509
 
      laneId       = 0
 
      noDataPoints = 64
 
          x/y/z = -0.009 / 1.795 / -0.015
 
          flags = 0x1, type = RDB_COORD_TYPE_USK, system = 0
 
          x/y/z = 1.578 / 1.819 / -0.015
 
          flags = 0x1, type = RDB_COORD_TYPE_USK, system = 0
 
          x/y/z = 3.164 / 1.874 / -0.016
 
          flags = 0x1, type = RDB_COORD_TYPE_USK, system = 0
 
          x/y/z = 4.749 / 1.961 / -0.018
 
          flags = 0x1, type = RDB_COORD_TYPE_USK, system = 0
 
          x/y/z = 6.332 / 2.080 / -0.020
 
          flags = 0x1, type = RDB_COORD_TYPE_USK, system = 0
 
          x/y/z = 7.912 / 2.230 / -0.023
 
          flags = 0x1, type = RDB_COORD_TYPE_USK, system = 0
 
          x/y/z = 9.489 / 2.411 / -0.026
 
          flags = 0x1, type = RDB_COORD_TYPE_USK, system = 0
 
          x/y/z = 11.062 / 2.623 / -0.030
 
          flags = 0x1, type = RDB_COORD_TYPE_USK, system = 0
 
          x/y/z = 12.630 / 2.866 / -0.035
 
          flags = 0x1, type = RDB_COORD_TYPE_USK, system = 0
 
          x/y/z = 14.194 / 3.141 / -0.040
 
          flags = 0x1, type = RDB_COORD_TYPE_USK, system = 0
 
          x/y/z = 15.751 / 3.446 / -0.046
 
          flags = 0x1, type = RDB_COORD_TYPE_USK, system = 0
 
          x/y/z = 17.303 / 3.783 / -0.055
 
 
---------------------------------------
 
Nun möchte ich gerne die jeweiligen Koordinaten zu x/y/z auslesen und in eine Matrix packen.
 
Kann mir hier jemand weiterhelfen?
 
 
Vielen Dank
 |   
 | 
 
| 
 | 
 
 
		
		 |  
		
		
		
  
		 | 
		 
		
| Harald | 
 
  
 
Forum-Meister
 
 
 | 
 
  | 
Beiträge: 24.502
 | 
  | 
 
 | 
 
  | 
Anmeldedatum: 26.03.09
 | 
  | 
 
 | 
 
  | 
Wohnort: Nähe München
 | 
  | 
 
 | 
 
  | 
Version: ab 2017b
 | 
  | 
 
 | 
 
 
 | 
 
  | 
 
  | 
      
Verfasst am: 19.06.2019, 18:06    
Titel: 
 | 
  | 
 
 
Hallo,
 
 
was hast du denn mit textscan versucht und wo genau liegen die Probleme? 
 
 
Das Überspringen der Zeilen mit flags ist möglich, indem du 'CommentStyle' auf 'flags' setzt.
 
 
Grüße,
 
Harald
 _________________
  1.) Ask MATLAB Documentation 
 
2.) Search gomatlab.de, google.de or MATLAB Answers
 
3.) Ask Technical Support of MathWorks
 
4.) Go mad, your problem is unsolvable ;)
 |   
 | 
 
| 
 | 
 
 
 
 
 
  
 | 
  
 | 
 
| 
Einstellungen und Berechtigungen
 | 
 
 
 | 
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen 
 | 
 
 
 
 |  
 
 
  Impressum
 | Nutzungsbedingungen
 | Datenschutz
 | FAQ
 |   RSS
  
  
  Hosted by: 
 
  
  
Copyright © 2007 - 2025
goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks 
 
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.
  
 
 | 
 
 
		 |