From: Rolf Pedersen Date: 2010-07-05T17:48:27+09:00 Subject: File data extraction --001636284ba6ddde3c048a9fff28 Content-Type: text/plain; charset=ISO-8859-1 Hi I have a file with the following format (example): Save Format v3.0(19990112) @begin Libraries "felles.pbl" ""; @end; @begin Objects "n_cst_xml_utils.sru" "felles.pbl"; "n_melding.sru" "felles.pbl"; @end; The data in the two begin/end blocks are lists, which may be longer than shown. I'd like to extract an array of the filenames (first quote) in the @begin Objects ... @end; block. For the example above this should return ["n_cst_xml_utils.sru", "n_melding.sru"] My initial idea was to treat the whole thing as one long string, and extract the part within the being-end-block by using regexp, converting the result back to individual lines (split '\n') and doing array.map and regexp to single out the name in the first quote on each line. But I keep hitting the wall, especially with the first step in this approach... :o( I know this should be easily done in a couple of lines of code, but I can't get it right. Appreciate any help! Best regards, Rolf --001636284ba6ddde3c048a9fff28--