Last active
August 29, 2015 14:22
-
-
Save adamabernathy/19537bb74a3d8d8a6f0c to your computer and use it in GitHub Desktop.
Save a value to a CSV file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; We have an array of values to save to a CSV file | |
| delim = ',' | |
| output_file = 'orbits.txt' | |
| data_to_save=make_array(2, /string, value=-999) | |
| data_to_save[0] = string(orbit_syear) | |
| data_to_save[1] = string(orbit_sdoy, format='(I03)') | |
| data_to_save[2] = string(orbit, format='(I05)') | |
| s='' | |
| lim = n_elements(data_to_save) | |
| for i = 0, lim - 1 do begin | |
| if i lt lim then begin | |
| s = s + data_to_save[i] + delim | |
| endif else begin | |
| s = s + data_to_save[i] | |
| endelse | |
| endfor | |
| ; Write out info to rundates-aux file | |
| openw, 1, output_file, /append | |
| printf, 1, s | |
| close, 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment