Import data with TabLoader and skipping first N lines

LabKey Support Forum (Inactive)
Import data with TabLoader and skipping first N lines Anthony Corbett  2013-04-22 12:16
Status: Closed
 
I have a file format from a Nanodrop instrument which looks like this:

Module:    Nucleic Acid
Path:    10 mm
Software:    3.7.1
Firmware:   
Sample ID    User ID    Date    Time    ng/ul    A260    A280    260/280    260/230   
Z109    Default     2/12/2013     2:31 PM     12.78     0.320     0.127
Z110    Default     2/12/2013     2:31 PM     8.88     0.222     0.065
Z111    Default     2/12/2013     2:32 PM     16.65     0.416     0.118


I am planning on creating a Java based assay module to import this data. I'm wondering if the TabLoader class has a way to skip the first 4 lines of this file or if I'll have to write my own parser.

It looks like the parent class DataLoader has a _skipLines member variable but its usage looks to be very specific and not generic enough for my use case. Am I correct in this?

Thanks,

Anthony
 
 
kevink responded:  2013-04-22 14:25
I think you can use _skipLines if you set it before .inferColumnInfo() is called by .initialize(). You may have to subclass TabLoader in order to set _skipLines. Maybe we need to expose a setter for _skipLines.

Another option would be to do something similar to TabLoader.getComments() in your subclass. The TabLoaderIterator will position the reader past the comments and header in it's constructor.