open and edit a lvm file (similar to txt file)

14 visualizzazioni (ultimi 30 giorni)
Si14
Si14 il 29 Lug 2012
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:

Risposte (1)

Image Analyst
Image Analyst il 29 Lug 2012
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?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by