I took the code a bit further to unpick some of the fields in the header
fcsFile = "my-fcs.fcs";
str = loadtextfile(fcsFile);
// extract header
pat = "FCS" + PatArb()>>hdr + "$BEGINANALYSIS";
isMatch = PatMatch(str,pat);
if (!isMatch,
throw("oops")
);
// extract selected header info
system = ""; // computer system
pat = "$SYS" + "|" + PatArb()>>system + "|";
PatMatch(hdr,pat);
cytometer = ""; // type of cytometer
pat = "$CYT" + "|" + PatArb()>>cytometer + "|";
PatMatch(hdr,pat);
startTime = ""; // start time
pat = "$BTIM" + "|" + PatArb()>>startTime + "|";
PatMatch(hdr,pat);
endTime = ""; // end time
pat = "$ETIM" + "|" + PatArb()>>endTime + "|";
PatMatch(hdr,pat);
show(system,cytometer,startTime,endTime);
For my test data file this gives
system = "Summit V5.2.0.7477 / Windows NT Version 5.1 / Intel Processor";
cytometer = "MoFlo XDP";
startTime = "12:34:07";
endTime = "12:38:15";
I used some field identifiers based on this documentation
https://www.bioconductor.org/packages/release/bioc/vignettes/flowCore/inst/doc/fcs3.html#3.1
-Dave