<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hello <span style="color: rgb(33, 33, 33); font-family: monospace; font-size: 13.3333px; background-color: rgb(255, 255, 255); display: inline !important">Stavros</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(33, 33, 33); font-family: monospace; font-size: 13.3333px; background-color: rgb(255, 255, 255); display: inline !important"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(33, 33, 33); font-family: monospace; font-size: 13.3333px; background-color: rgb(255, 255, 255); display: inline !important">You are right, if I do dos2unix, I remove one ^M at each line, and do another dos2unix and remove the other
^M at each line. </span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(33, 33, 33); font-family: monospace; font-size: 13.3333px; background-color: rgb(255, 255, 255); display: inline !important">So to be safe, I probably need to do once or twice dos2unix before I readAsciiTable</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(33, 33, 33); font-family: monospace; font-size: 13.3333px; background-color: rgb(255, 255, 255); display: inline !important"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(33, 33, 33); font-family: monospace; font-size: 13.3333px; background-color: rgb(255, 255, 255); display: inline !important">Thanks a lot!</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(33, 33, 33); font-family: monospace; font-size: 13.3333px; background-color: rgb(255, 255, 255); display: inline !important">Xiaoming </span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> sdafis <sdafis@noa.gr><br>
<b>Sent:</b> Thursday, November 8, 2018 2:58 PM<br>
<b>To:</b> xiaoming Hu<br>
<b>Cc:</b> ncl-talk@ucar.edu; Xiaoming Hu<br>
<b>Subject:</b> Re: [ncl-talk] how to tell readAsciiTable to ignore ^M ?</font>
<div> </div>
</div>
<div style="font-size:10pt; font-family:Verdana,Geneva,sans-serif">
<p>Hi Xiaoming, </p>
<p>It seems that you are trying to read a file DOS line endings. You must convert it to Unix type, so I suggest using a software like dos2unix:<br>
<a href="http://dos2unix.sourceforge.net/">http://dos2unix.sourceforge.net/</a></p>
<p>There are plenty of other ways of converting the file. Then NCL will read the file without problems.</p>
<p>Good luck!</p>
<p><br>
-- </p>
<div class="x_pre" style="margin:0; padding:0; font-family:monospace">Stavros NTAFIS (DAFIS)<br>
-----------------------------------------------<br>
Physicist - Meteorologist, M.Sc.<br>
Ph.D. Candidate, Polytechnic School of Paris, France<br>
Laboratory of Dynamic Meteorology (LMD)<br>
Research Associate, National Observatory of Athens (NOA/IERSD)<br>
Tel. : (+33)1 69 33 51 64<br>
(+33)9 81 94 22 12<br>
Mobile: (+33) 066 030 0147<br>
(+30) 697 04 20 242<br>
---------------<br>
Weather charts:<br>
<a href="http://www.meteo.gr" target="_blank" rel="noopener noreferrer">http://www.meteo.gr</a><br>
<a href="http://www.meteo.gr/meteomaps/" target="_blank" rel="noopener noreferrer">http://www.meteo.gr/meteomaps/</a></div>
<p><br>
</p>
<p><br>
</p>
<p>Στις 2018-11-08 21:50, xiaoming Hu έγραψε:</p>
<blockquote type="cite" style="padding:0 0.4em; border-left:#1010ff 2px solid; margin:0">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
Hello</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
I have trouble to readAsciiTable the following data: </div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
<span>VERSION 03.30^M^M<br>
</span>
<div>54342 0123.5167 041.7333 0052.5^M^M</div>
<div>GFE(L)-1 12.2 GTS1 -00262833792 028 0750 0400 2650 1500 352^M^M</div>
<div>026.0 026.0 00.0 1000.7 1001.2 -0.5 068 065 03 1^M^M</div>
<div>20130714111522 20130714192922 20130714123100 20130714123100 06 06 26985 25904 002.00 28.1 1000.7 069 000 000.0 010.0 00 // // 000 10- // // // 090.00 -01.00 070.00^M^M</div>
<div>ZCZC SECOND^M^M</div>
<div>TimeStep T Press RH angle direction distance delta_lon delta_lat xx xx xx</div>
<div> 0.000 28.100 1000.700 69.000 -1.000 90.000 0.070 0.000 0.000 0.000 0.000 52.000</div>
<div> 1.000 -999.000 -999.000 -999.000 3.370 67.810 0.108 0.000 0.000 0.000 0.000 64.000</div>
<div> 2.000 -999.000 -999.000 -999.000 3.970 67.620 0.108 0.000 0.000 0.000 0.000 69.000</div>
<span></span>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
</div>
see:</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
<span>ncl 8> data_second = readAsciiTable("Z_UPAR_I_54342_20130712111513_O_TEMP-L.txt.SECOND", 12, "float", 7) <br>
</span>
<div>warning:asciiread: End of file reached and only (76173) elements were read from the file, filling remaining elements with the default missing value for the requested type</div>
<div>ncl 9> print(data_second(:2,0)) </div>
<div> </div>
<div> </div>
<div>Variable: data_second (subsection)</div>
<div>Type: float</div>
<div>Total Size: 12 bytes</div>
<div> 3 values</div>
<div>Number of Dimensions: 1</div>
<div>Dimensions and sizes: [3]</div>
<div>Coordinates: </div>
<div>Number Of Attributes: 1</div>
<div> _FillValue : 9.96921e+36</div>
<div>(0) 2.013071e+13</div>
<div>(1) 315</div>
<div>(2) 70</div>
<span></span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
It appears NCL treated ^M^M as an additional line. </div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
How can I tell NCL to treat ^M as characters? </div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
Thanks</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
Xiaoming </div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
</div>
<br>
<div class="x_pre" style="margin:0; padding:0; font-family:monospace">_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank" rel="noopener noreferrer">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></div>
</blockquote>
<p><br>
</p>
</div>
</body>
</html>