<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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: 14pt; color: rgb(0, 0, 0);">
<span style="font-size: 12pt; color: rgb(51, 51, 51); font-family: Cambria, Georgia, serif;">Hi Mateus.</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 14pt; color: rgb(0, 0, 0);">
<span style="font-size: 12pt; color: rgb(51, 51, 51); font-family: Cambria, Georgia, serif;">Thanks for the feedback,
</span><span style="font-size: 12pt; color: rgb(51, 51, 51); font-family: Cambria, Georgia, serif;">but this is not what I intend to do.</span><br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 14pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 14pt; color: rgb(0, 0, 0);">
<span style="font-size: 12pt; color: rgb(51, 51, 51); font-family: Cambria, Georgia, serif;">In my ascii file, I have several lines with the same date (e.g. 2018-01-01, ...) and in this proposed way, I would save 1 file for each line. However, what I need is
to save each file for each unique date.</span><br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 14pt; color: rgb(0, 0, 0);">
<span style="font-size: 12pt; color: rgb(51, 51, 51); font-family: Cambria, Georgia, serif;">With the "test.txt" data I have 9 different dates, which I need to save as 9 different ascii files, containing all the information.</span><br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 14pt; color: rgb(0, 0, 0);">
<span style="font-size: 12pt; color: rgb(51, 51, 51); font-family: Cambria, Georgia, serif;">The function I used selects the dates in common, but I am missing something in the loop to save joining this information.</span><br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 14pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 14pt; color: rgb(0, 0, 0);">
<span style="font-size: 12pt; color: rgb(51, 51, 51); font-family: Cambria, Georgia, serif;">Thanks for the advance</span><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>De:</b> Mateus da Silva Teixeira <mateusstex@gmail.com><br>
<b>Enviado:</b> terça-feira, 3 de março de 2020 15:19<br>
<b>Para:</b> Vanúcia Schumacher <vanucia-schumacher@hotmail.com><br>
<b>Cc:</b> ncl-talk@ucar.edu <ncl-talk@ucar.edu><br>
<b>Assunto:</b> Re: [ncl-talk] Selecting same date</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>Hi Vanucia,</div>
<div><br>
</div>
<div>Take a look at the following lines:</div>
<div><br>
</div>
<div><i> asciifile = asciiread( "test.txt", -1, "string" )<br>
nlines = dimsizes( asciifile )<br>
<br>
dates = str_get_field( asciifile(1:nlines-1), 1, ";" )<br>
dates_nano = str_get_field( asciifile(1:nlines-1), 2, ";" )<br>
lat = str_get_field( asciifile(1:nlines-1), 3, ";" )<br>
lon = str_get_field( asciifile(1:nlines-1), 4, ";" )<br>
pico_ka = str_get_field( asciifile(1:nlines-1), 5, ";" )<br>
<br>
print( dates )<br>
print( dates_nano )<br>
print( lat )<br>
print( lon )<br>
print( pico_ka )</i></div>
<div><i><br>
</i></div>
<div>After reading all data, you can easily save them in an ascii file. Of course, if you want to make some calculations with these data you should convert from string to float.<br>
</div>
<div><br>
</div>
<div>Best regards,</div>
<div>Mateus</div>
<div><br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">Em ter., 3 de mar. de 2020 às 12:01, Vanúcia Schumacher via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>> escreveu:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:14pt; color:rgb(0,0,0)">
<span style="color:rgb(51,51,51); font-size:12pt; font-family:Cambria,Georgia,serif">Hi users,</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:14pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:14pt; color:rgb(0,0,0)">
<span style="color:rgb(51,51,51); font-size:12pt; font-family:Cambria,Georgia,serif">I need help to fix my ncl script, </span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:14pt; color:rgb(0,0,0)">
<span style="color:rgb(51,51,51); font-size:12pt; font-family:Cambria,Georgia,serif">what I'm trying to do is select all the same dates from the ascii file (test.txt) and save it </span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:14pt; color:rgb(0,0,0)">
<span style="color:rgb(51,51,51); font-size:12pt; font-family:Cambria,Georgia,serif">in a new ascii file (refers to each date), but I'm not able to get all the values for each date.</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:14pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:14pt; color:rgb(0,0,0)">
<span style="color:rgb(51,51,51); font-size:12pt; font-family:Cambria,Georgia,serif">I attached the test data and the script</span><span><br>
</span>
<div><br>
</div>
<span style="color:rgb(51,51,51); font-size:12pt; font-family:Cambria,Georgia,serif">I appreciate any help</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:14pt; color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:14pt; color:rgb(0,0,0)">
<span style="color:rgb(51,51,51); font-size:12pt; font-family:Cambria,Georgia,serif">Cheers</span></div>
</div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote>
</div>
</div>
</body>
</html>