LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to read Labview Txt File in Matlab

Hi,

 

I have generated a text file in labview with file I/O's. when i am trying to read it in matlab 

 

the matlab is showing an error as 

 

??? Error using ==> dlmread at 145
Mismatch between file and format string.
Trouble reading number from file (row 1, field 1) ==> …Eôþô

 

Thanks.

0 Kudos
Message 1 of 5
(3,738 Views)

It doesn't seem to be a normal text file, it involves some sort of formatting. Can you show the File write function that you have made?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 5
(3,714 Views)

Hi,

 

You created a Binary file, not a Text file.

Certified LabVIEW Developer
0 Kudos
Message 3 of 5
(3,706 Views)

Hi,

 

This is not a binary file. I performed a real time demodulation(communication), converted the binary bits to ascii string characters and saved in a text file.

 

Okay,  I have created a simple text file in labview and i tried to read in the matlab. the same error occurs.

 

dlmread('Test.txt');
??? Error using ==> dlmread at 145
Mismatch between file and format string.
Trouble reading number from file (row 1, field 1) ==> kjfhe

 

what i found is that the labview saves in ASCII text but not in plain text.

 

 

Also  I created a tab delimited Text file. the same error follows

 

??? Error using ==> dlmread at 145
Mismatch between file and format string.
Trouble reading number from file (row 1, field 2) ==> :10:2

 

Download All
0 Kudos
Message 4 of 5
(3,698 Views)

sagar.vidhyam@yahoo.com wrote:

 

This is not a binary file. I performed a real time demodulation(communication), converted the binary bits to ascii string characters and saved in a text file.

 


Then your bits-to-ASCII conversion was wrong. Open Testfile1.txt and have a look: that's not an ASCII file.

 

Please post your code. We can't help you otherwise.

 


sagar.vidhyam@yahoo.com wrote:

 

what i found is that the labview saves in ASCII text but not in plain text.

 


What do you mean? ASCII text is plain text!

 


sagar.vidhyam@yahoo.com wrote:

 

Also  I created a tab delimited Text file. the same error follows

 

??? Error using ==> dlmread at 145
Mismatch between file and format string.
Trouble reading number from file (row 1, field 2) ==> :10:2

 


That's not LabVIEW's problem.

 

MATLAB's dlmread only accepts numbers -- it won't accept timestamps like "4:10:27 PM" or alphabetic strings like "kjfhefghk..." (please see MATLAB's documentation)

Certified LabVIEW Developer
0 Kudos
Message 5 of 5
(3,680 Views)