open and edit a lvm file (similar to txt file)
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi,
I have a lvm file (labview measurement file) which I open with Notepad or other text editors. So, I hope I can open and edit it as a text file in Matlab as well.
I want to delete the first 20 lines of the file. Could you please advise?
Thanks.
A sample lvm file:
댓글 수: 0
답변 (1개)
Image Analyst
2012년 7월 29일
Basically you'll use fopen() (twice once for the input file and once for the output file), then fgets() from the input file 20 times, then loop where you fgets() from the input file, fprintf() to the output file, then fclose() both input and output file. If you want, delete the input file and use copyfile() or movefile() to copy the new file with the 230 missing lines to have the same name as the original input file.
It's pretty obvious so I'm sure you already tried it, but what was the error or unexpected results you encountered?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Low-Level File I/O에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!