extractReportInfo <- function(f, skip=0, nrows=1, header="auto", justDateCols=FALSE, prepend.Report=FALSE) {
## prepend.Report  :   This wil lconvert 'start date' and 'end date' to 'report start date' and 'report end date' appropriately

    ## This is ideal.  But fread is over-riding the skip=0L
    input <- f
    input <- pasteC(readLines(f, n=nrows+skip+!identical(header, FALSE)), C="\n")
    DT.info <- fread(input, skip=skip, nrows=nrows, header=header, autostart=1L)

    ## Clean Date format
    dateCols <- getDateColNames(DT.info)
    # browser(expr=(!any(grepl("report", dateCols, ignore.case=TRUE))), text="in extractReportInfo()")
    for (col in dateCols) {
      ## Convert to standard %Y-%m-%d format
      DT.info[grepl("^\\d{2}/\\d{2}/\\d{2}", get(col)), (col)  := format(as.Date(get(col), format="%m/%d/%y", origin=.origin), format="%Y-%m-%d")]
      ## Convert all to Date
      DT.info[, (col) := format(as.Date(get(col), origin=.origin), "%Y-%m-%d")]
      
      if (prepend.Report && tolower(col) %in% c("start date", "end date"))
        setnames(DT.info, col, sprintf("Report %s", tolower(col)))
    }



    if (justDateCols) {
      return(DT.info[, getDateColNames(DT.info), with=FALSE]) ## re-extract in case changed
    }
    else 
      return(DT.info)
}
