If treating the NaN's in a text file as zeros is okay, then consider setting AFNI_1D_ZERO_TEXT = YES either in your .afnirc file or on the command line or script.
cat > test.1D
NAN
nan
NaN
^C
1dcat test.1D
** Error: Failed parsing data row 0 of 1D file 'test.1D'
Check for illegal non-numeric characters in:
'NAN'
You can have text entries set to 0 with -ok_1D_text or by
setting environment variable AFNI_1D_ZERO_TEXT to YES.
** FATAL ERROR: Can't read input file 'test.1D'
** Program compile date = Dec 12 2019
1dcat -DAFNI_1D_ZERO_TEXT=YES test.1D
0
0
0