Changeset 2536


Ignore:
Timestamp:
Jul 1, 2014, 3:30:31 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #613: Auto-detect tab or comma in Caliper-files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/CaliperPlateImporter.java

    r2454 r2536  
    185185      return false; // Can't continue if no data is found in the file
    186186    }
     187   
     188    boolean useComma = ffp.getLine(ffp.getLineCount()-1).line().startsWith("Plate Name,");
     189    ffp.setDataSplitterRegexp(Pattern.compile(useComma ? "," : "\t"));
    187190   
    188191    Mapper plateMapper = ffp.getMapper("\\Plate Name\\");
     
    397400    FlatFileParser ffp = new FlatFileParser();
    398401   
    399     ffp.setDataHeaderRegexp(Pattern.compile("Plate Name,Well Label,Sample Name,.*"));
    400     ffp.setDataSplitterRegexp(Pattern.compile(",")); // Split on comma
     402    ffp.setDataHeaderRegexp(Pattern.compile("Plate Name(,|\t)Well Label(,|\t)Sample Name(,|\t).*"));
     403    ffp.setDataSplitterRegexp(Pattern.compile(",|\t")); // Split on comma or tab to begin with
    401404   
    402405    ffp.setIgnoreRegexp(Pattern.compile(".*Ladder.*")); // Ignore all lines that contain 'Ladder'
Note: See TracChangeset for help on using the changeset viewer.