pro ls_ls ; ; builds a list of files by reading the contents of a list of ; files (to get around the Windows limit on input buffer size). ; ; This program allows the user to select a bunch of files that ; themselves contain lists of files. This program will read ; and assemble the full list and write it to a single output ; file ; ; DPC 20051102 original code ; files = dialog_pickfile(Title="Select Files:",/MULTIPLE_FILES) nfiles = size(files) nfiles = nfiles[1] ; outfile = dialog_pickfile(Title="Name a file to contain the full list of files") openw, lu_out, outfile, /GET_LUN ; ; for each input file, read the file ; ; then write to the output file ; ; for fun, keep a tally of the total number of files written ; ntotal = 0L list = strarr(2000) line = '' for ifile = 0L, nfiles-1 do begin openr, lu_in, files[ifile], /GET_LUN nlist = 0L while (~EOF(lu_in)) do begin readf, lu_in, line list[nlist] = STRTRIM(line,2) nlist++ endwhile FREE_LUN, lu_in ; for i = 0, nlist-1 do begin printf, lu_out, list[i] ntotal++ endfor endfor ; FREE_LUN, lu_out print, "Total number of entries moved = ",ntotal ; print, "LS_LS is Done!" ; end