XMM-Newton SAS Home Page
XMM-Newton Science Analysis System


ssclib (ssclib-4.36.1) [xmmsas_20230412_1735-21.0.0]


List Parsing

Module name: parse_list_mod

Author: Dean Hinshaw (NASA/GFSC, dah@milkyway.gsfc.nasa.gov)

This subroutine parses a string containing a delimited list into an array of strings, one element for each member of the list. The calling sequence is:

    SUBROUTINE parse_list(in_str, out_array, in_delim)
 
    CHARACTER(LEN=*), DIMENSION(:), POINTER :: out_array
    CHARACTER(LEN=*),                       :: in_str
    CHARACTER(LEN=1), OPTIONAL, INTENT(IN)  :: in_delim

where in_str is the string to be parsed, out_array is returned array of strings, and in_delim is the delimeter seperating the list items. in_delim is an optional parameter, and if not given defaults to a space. Note that in any case list items may not contain spaces. The user also must take care that the pointer passed as out_array has sufficient length to hold the parsed strings.

Additional, if in_str begins with an “@”, then the string is taken as a filename the list items, one item for each line of the file.



XMM-Newton SOC -- 2023-04-16