/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package test; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.LineNumberInputStream; import java.util.Scanner; import java.util.regex.Pattern; import org.autoplot.ScriptContext; import org.das2.qds.DDataSet; import org.das2.qds.QDataSet; import org.das2.qds.ops.Ops; import org.das2.qds.util.DataSetBuilder; /** * * @author jbf */ public class ScannerTest { private static String TEST_FILE; public static void main(String[] args) throws FileNotFoundException, Exception { TEST_FILE = "/home/jbf/project/cassini/BobsFiles/data_look_asc"; // findbugs File file= new File( TEST_FILE); int nds= 16; DataSetBuilder ttag = new DataSetBuilder( 1, 100); LineNumberInputStream lnr = new LineNumberInputStream(new FileInputStream(file)); Scanner s = new Scanner(lnr); s.next("sizes"); int nfreq= s.nextInt(); s.nextInt(); // skip this mysterious number s.next("freqs"); DDataSet freqs= DDataSet.createRank1(nfreq); for ( int i=0; i