Dear group,<br><br>I have a few files that contains data in IEEE 754 format. I need to transform them into a csv file, to be able to read these files in another program. Each file has 30000 samples of I and Q. I did develop the attached script. I am sure not the best, but it worked at home on my Linux installation Python 
2.4. I was then very confident that it would work also on my work pc (XP with python 2.3). It does not, I get the following error <br><br>Traceback (most recent call last):<br>&nbsp; File &quot;C:\Python23\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py&quot;, line 310, in RunScript
<br>&nbsp;&nbsp;&nbsp; exec codeObject in __main__.__dict__<br>&nbsp; File &quot;E:\OFDMA_test\iqw.py&quot;, line 16, in ?<br>&nbsp;&nbsp;&nbsp; x[i/4]=unpack('f',a[i:i+4])[0]<br>error: unpack str size does not match format<br><br><br>apparently the XP box thinks the file is alot shorter, and that can't be as it is the same file from the same media (USB stick). What is going wrong here?
<br><br><br>/Johan<br><br><br>import os<br><br>from struct import *<br>from scipy import *<br><br><br><br>f=file(&quot;c:\\tmp\\FSL_good_SNR\\Last_IQ.iqw&quot;,'r')<br>a=f.read()<br>f.close()<br><br>x=zeros(len(a)/4)+0.0<br>
<br>for i in range (0, len(a),4):<br>&nbsp;&nbsp;&nbsp; x[i/4]=unpack('f',a[i:i+4])[0]<br><br>y=x[0:len(x)/2-1]+1j*x[len(x)/2:len(x)-1]<br><br>writer = file(&quot;c:\\tmp\\FSL_good_SNR\\IQ.csv&quot;, 'w')<br>for item in y:<br>&nbsp;&nbsp;&nbsp; writer.write
(repr(real(item))+','+repr(imag(item))+'\n')<br>writer.close()<br><br>