delete element from txt file
Mostrar comentarios más antiguos
hi, is there a way to delete element from txt file . I have files ,I want delete the first two elements in each file.
the structure of my file(1) as:
1:
text.....
file(2)
2:
text.....
etc.
I want to delete 1:, 2:, 3: etc...
thanks
Respuestas (1)
Walter Roberson
el 6 de Nov. de 2011
0 votos
It is greatly recommended that if you need to delete something from a text file, that you copy the parts that you want to keep to a new file, possibly renaming files afterwards. Deleting text from an existing file is messy.
5 comentarios
huda nawaf
el 6 de Nov. de 2011
Walter Roberson
el 6 de Nov. de 2011
The 1:, 2: and so on: if there is only one such line per file and it is the first line of the file, then specify 'HeaderLines', 1 when you textscan.
If there are multiple instances per file, then is there always the same number of lines between instances?
huda nawaf
el 7 de Nov. de 2011
huda nawaf
el 7 de Nov. de 2011
Walter Roberson
el 7 de Nov. de 2011
c = textscan(f,'%f %f %s','Delimiter',',','headerLines',1);
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!