lib/cmsTxtToIntObj.js
function getTitles(fileString) {
    var headerMatchCode = '(-){4,}[\\S\\s]+?(\\n){2,}(-){4,}';
    var headerRegExp = new RegExp(headerMatchCode, 'gi');
    var rawTitleArray = fileString.match(headerRegExp);
    var titleArray = [];
    if (rawTitleArray === null) {
        return null;
    }
    for (var i = 0, len = rawTitleArray.length; i < len; i++) {
        var tempTitle = cleanUpTitle(rawTitleArray[i]);
        //exception to the rule, claim lines
        if (tempTitle.toLowerCase().indexOf("claim lines for claim number") < 0 &&
            tempTitle.length > 0) {
            titleArray[i] = tempTitle;
        }
    }
    return titleArray;
}
function getTitles(fileString) {
    var headerMatchCode = '(-){4,}[\\S\\s]+?(\\n){2,}(-){4,}';
    var headerRegExp = new RegExp(headerMatchCode, 'gi');
    var rawTitleArray = fileString.match(headerRegExp);
    var titleArray = [];
    if (rawTitleArray === null) {
        return null;
    }
    for (var i = 0, len = rawTitleArray.length; i < len; i++) {
        var tempTitle = cleanUpTitle(rawTitleArray[i]);
        //exception to the rule, claim lines
        if (tempTitle.toLowerCase().indexOf("claim lines for claim number") < 0 &&
            tempTitle.length > 0) {
            titleArray[i] = tempTitle;
        }
    }
    return titleArray;
}
function getTitles ( fileString ) { var headerMatchCode = '(-){4,}[\\S\\s]+?(\\n){2,}(-){4,}' ; var headerRegExp = new RegExp ( headerMatchCode , 'gi' ) ; var rawTitleArray = fileString . match ( headerRegExp ) ; var titleArray = [ ] ; if ( rawTitleArray === null ) { return null ; } for ( var i = 0 , len = rawTitleArray . length ; i < len ; i ++ ) { var tempTitle = cleanUpTitle ( rawTitleArray [ i ] ) ; //exception to the rule, claim lines if ( tempTitle . toLowerCase ( ) . indexOf ( "claim lines for claim number" ) < 0 && tempTitle . length > 0 ) { titleArray [ i ] = tempTitle ; } } return titleArray ; }
Gets all section titles given the entire data file string
Gets all section titles given the entire data file string