title: Importing .dat files in python without knowing how it is structured
body: <p>I am trying to load and see the contents of data which can be downloaded from <a href="https://pds-ppi.igpp.ucla.edu/search/view/?f=yes&amp;id=pds://PPI/JNO-J_SW-JAD-3-CALIBRATED-V1.0/DATA/2018/2018091/ELECTRONS/JAD_L30_LRS_ELC_ANY_CNT_2018091_V03&amp;o=1" rel="nofollow noreferrer">here</a>. After which I need to analyze it. In this regard, I had already <a href="https://stackoverflow.com/questions/66631516/importing-dat-file-into-matlab">posed on problem</a>, but I could not get any solution.</p>
  <p>Now, I went through their label file located <a href="https://pds-ppi.igpp.ucla.edu/ditdos/viewFile?id=pds://PPI/JNO-J_SW-JAD-3-CALIBRATED-V1.0/DATA/2018/2018091/ELECTRONS/JAD_L30_LRS_ELC_ANY_CNT_2018091_V03.LBL" rel="nofollow noreferrer">here</a>. In that, it is mentioned that</p>
  <blockquote>
  <p>“Will code useful Python based letters to describe each object<br />
  <em>/ /</em> see <a href="http://docs.python.org/library/struct.html" rel="nofollow noreferrer">http://docs.python.org/library/struct.html</a> for codes                 <em>/ /</em> formats will comma separated beginning with &quot;RJW,&quot; as key then           <em>/ /</em> {NAME}, {FORMAT}, {Number of dims}, {Size Dim 1}, {Size Dim 2}, ...      <em>/ /</em> where {FORMAT} is the Python code for the type, i.e. I
  for uint32        <em>/ /</em> and there are as many Size Dim's as number of
  dimensions. ”</p>
  </blockquote>
  <p>So, I guess one can try python. I do have a working knowledge in python. So, I started with this program which I got from <a href="https://stackoverflow.com/questions/42704087/import-dat-file-in-python-3/43341198">here</a> (for simplicity python file and the data files are in same folder):</p>
  <pre><code>import numpy as np
  data = np.genfromtxt('JAD_L30_LRS_ELC_ANY_CNT_2018091_V03.dat')
  print(data)
  </code></pre>
  <p>I got the error <code>“UnicodeDecodeError: 'cp949' codec can't decode byte 0xff in position 65: illegal multibyte sequence”.</code></p>
  <p>If I change the code to <a href="https://stackoverflow.com/questions/62844140/how-to-fix-unicodedecodeerror-cp949-codec-cant-decode-byte-0xeb-in-position">(as mentioned here)</a>:</p>
  <pre><code>data=open('JAD_L30_LRS_ELC_ANY_CNT_2018091_V03.DAT', encoding='utf-8')
  print(data)
  </code></pre>
  <p>The error message disappears, but all I get is:</p>
  <p><code>&lt;_io.TextIOWrapper name='JAD_L30_LRS_ELC_ANY_CNT_2018091_V03.DAT' mode='r' encoding='utf-8'&gt;</code></p>
  <p>I had checked other answers in in StackOverflow, but could not get any answer. My question may be closely similar to what is posted <a href="https://stackoverflow.com/questions/59782618/reading-dat-file-in-python">here</a></p>
  <p>I need to first see the contents of this dat file and then export to other format, say .csv.</p>
  <p>Any help will be deeply appreciated...</p>