delete element from txt file
이전 댓글 표시
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
답변 (1개)
Walter Roberson
2011년 11월 6일
0 개 추천
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
huda nawaf
2011년 11월 6일
Walter Roberson
2011년 11월 6일
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
2011년 11월 7일
huda nawaf
2011년 11월 7일
Walter Roberson
2011년 11월 7일
c = textscan(f,'%f %f %s','Delimiter',',','headerLines',1);
카테고리
도움말 센터 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!