LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

closing a worksheet

I have a folder of 300 samples of speech (*.wav) files. I have created a VI which opens each of this file ( by a for loop) and do some processing. The output of this VI is a excel sheet. 

 

I creating an excel sheet which contains the features of the speech file. 

 

Database creation.jpg

 

But this VI doesn't work. I think it is because after each iteration I must close each excel file. How to do this? 

0 Kudos
Message 1 of 6
(3,247 Views)

Hello Shweta,

 

You are using High level file operation VIs. LV internally handles all the operations.

Kindly attach your that particular VI.

Check whether any excel sheet is created or not.

If not then check path.

 

test1.png

Just for reference.

 

Regards,

Bijay

0 Kudos
Message 2 of 6
(3,233 Views)

First off, you are not creating Excel sheets. The VI you are using is Write to Spreadsheet File. That creates a text file, not an Excel workbook. Please read the documentation.

 

Second, do not use string functions to create paths! Use the file functions to build your paths.

 

Third, do not hard code paths in your code! Provide a front panel control to specify the base path.

 

Fourth, what does "the VI doesn't work" mean? Does it not create files? Are the files empty? Are you getting an error? If so, what is that error?

0 Kudos
Message 3 of 6
(3,222 Views)

you are right I noticed the same mistakes !

0 Kudos
Message 4 of 6
(3,218 Views)

Pardon me for my vague wordings...

 

I'll look into what you have suggested and get back to you. I have'nt used file functions at all so far. I didn't know how to use it. One of my friends suggested to do it this way.

 

I have speech samples named w1p1s1.wav  w1p1s2... ( referring to word 1 uttered by person 1 and sample 1 ( each person repeats the word 5 times) )

 

I have to extract the features in each of this wav file. I was manually selecting the path for each file in the folder and giving the name to the xls file. But it was too much work for 300 samples. 

 

How shall I do this?

 

This VI worked for only the first file. The second file had only 1 row of data and the next had no lines of data (empty). 

0 Kudos
Message 5 of 6
(3,208 Views)

Are you sure that custom VI you have is extracting the information correctly? Have you put a probe on the output wire, or have the subVI open so you can see the data that's being written.

 

If you use the right file I/O functions you only need to use one loop (plus, it's independent of the actual number of files, unlike your code, which is hard coded for each parameter):

 

 

0 Kudos
Message 6 of 6
(3,197 Views)