docs/src/private/website/netcdf-java/tutorial/files/UspLightning1.java
int readAllData(RandomAccessFile raf) throws IOException, NumberFormatException, ParseException {
    ArrayList records = new ArrayList();

    java.text.SimpleDateFormat isoDateTimeFormat = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
    isoDateTimeFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));

    //java.io.RandomAccessFile jraf = raf.getRandomAccessFile();

    raf.seek(0);
    int count = 0;
    while (true) {
      String line = raf.readLine();
      if (line == null) break;
      if (line.startsWith(MAGIC)) continue;

      StringTokenizer stoker = new StringTokenizer(line, ",\r\n");
      while (stoker.hasMoreTokens()) {
        Date d = isoDateTimeFormat.parse(stoker.nextToken());
        double lat = Double.parseDouble(stoker.nextToken());
        double lon = Double.parseDouble(stoker.nextToken());
        double amp = Double.parseDouble(stoker.nextToken());
        String tok = stoker.nextToken();
        int nstrikes = Integer.parseInt(tok);

        Strike s = new Strike(d, lat, lon, amp, nstrikes);
        records.add(s);
        if (count < 10)
          System.out.println(count + " " + isoDateTimeFormat.format(d) + " " + s);
      }

      count++;
    }

    System.out.println("processed " + count + " records");

    int n = records.size();
    int[] shape = new int[]{n};
    dateArray = (ArrayInt.D1) Array.factory(DataType.INT, shape);
    latArray = (ArrayDouble.D1) Array.factory(DataType.DOUBLE, shape);
    lonArray = (ArrayDouble.D1) Array.factory(DataType.DOUBLE, shape);
    ampArray = (ArrayDouble.D1) Array.factory(DataType.DOUBLE, shape);
    nstrokesArray = (ArrayInt.D1) Array.factory(DataType.INT, shape);

    for (int i = 0; i < records.size(); i++) {
      Strike strike = (Strike) records.get(i);
      dateArray.set(i, strike.d);
      latArray.set(i, strike.lat);
      lonArray.set(i, strike.lon);
      ampArray.set(i, strike.amp);
      nstrokesArray.set(i, strike.n);
    }

    return n;
  }
int readAllData(RandomAccessFile raf) throws IOException, NumberFormatException, ParseException {
    ArrayList records = new ArrayList();

    java.text.SimpleDateFormat isoDateTimeFormat = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
    isoDateTimeFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));

    //java.io.RandomAccessFile jraf = raf.getRandomAccessFile();

    raf.seek(0);
    int count = 0;
    while (true) {
      String line = raf.readLine();
      if (line == null) break;
      if (line.startsWith(MAGIC)) continue;

      StringTokenizer stoker = new StringTokenizer(line, ",\r\n");
      while (stoker.hasMoreTokens()) {
        Date d = isoDateTimeFormat.parse(stoker.nextToken());
        double lat = Double.parseDouble(stoker.nextToken());
        double lon = Double.parseDouble(stoker.nextToken());
        double amp = Double.parseDouble(stoker.nextToken());
        String tok = stoker.nextToken();
        int nstrikes = Integer.parseInt(tok);

        Strike s = new Strike(d, lat, lon, amp, nstrikes);
        records.add(s);
        if (count < 10)
          System.out.println(count + " " + isoDateTimeFormat.format(d) + " " + s);
      }

      count++;
    }

    System.out.println("processed " + count + " records");

    int n = records.size();
    int[] shape = new int[]{n};
    dateArray = (ArrayInt.D1) Array.factory(DataType.INT, shape);
    latArray = (ArrayDouble.D1) Array.factory(DataType.DOUBLE, shape);
    lonArray = (ArrayDouble.D1) Array.factory(DataType.DOUBLE, shape);
    ampArray = (ArrayDouble.D1) Array.factory(DataType.DOUBLE, shape);
    nstrokesArray = (ArrayInt.D1) Array.factory(DataType.INT, shape);

    for (int i = 0; i < records.size(); i++) {
      Strike strike = (Strike) records.get(i);
      dateArray.set(i, strike.d);
      latArray.set(i, strike.lat);
      lonArray.set(i, strike.lon);
      ampArray.set(i, strike.amp);
      nstrokesArray.set(i, strike.n);
    }

    return n;
  }
int readAllData ( RandomAccessFile raf ) throws IOException , NumberFormatException , ParseException { ArrayList records = new ArrayList ( ) ; java . text . SimpleDateFormat isoDateTimeFormat = new java . text . SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss" ) ; isoDateTimeFormat . setTimeZone ( java . util . TimeZone . getTimeZone ( "GMT" ) ) ; //java.io.RandomAccessFile jraf = raf.getRandomAccessFile(); raf . seek ( 0 ) ; int count = 0 ; while ( true ) { String line = raf . readLine ( ) ; if ( line == null ) break ; if ( line . startsWith ( MAGIC ) ) continue ; StringTokenizer stoker = new StringTokenizer ( line , ",\r\n" ) ; while ( stoker . hasMoreTokens ( ) ) { Date d = isoDateTimeFormat . parse ( stoker . nextToken ( ) ) ; double lat = Double . parseDouble ( stoker . nextToken ( ) ) ; double lon = Double . parseDouble ( stoker . nextToken ( ) ) ; double amp = Double . parseDouble ( stoker . nextToken ( ) ) ; String tok = stoker . nextToken ( ) ; int nstrikes = Integer . parseInt ( tok ) ; Strike s = new Strike ( d , lat , lon , amp , nstrikes ) ; records . add ( s ) ; if ( count < 10 ) System . out . println ( count + " " + isoDateTimeFormat . format ( d ) + " " + s ) ; } count ++ ; } System . out . println ( "processed " + count + " records" ) ; int n = records . size ( ) ; int [ ] shape = new int [ ] { n } ; dateArray = ( ArrayInt . D1 ) Array . factory ( DataType . INT , shape ) ; latArray = ( ArrayDouble . D1 ) Array . factory ( DataType . DOUBLE , shape ) ; lonArray = ( ArrayDouble . D1 ) Array . factory ( DataType . DOUBLE , shape ) ; ampArray = ( ArrayDouble . D1 ) Array . factory ( DataType . DOUBLE , shape ) ; nstrokesArray = ( ArrayInt . D1 ) Array . factory ( DataType . INT , shape ) ; for ( int i = 0 ; i < records . size ( ) ; i ++ ) { Strike strike = ( Strike ) records . get ( i ) ; dateArray . set ( i , strike . d ) ; latArray . set ( i , strike . lat ) ; lonArray . set ( i , strike . lon ) ; ampArray . set ( i , strike . amp ) ; nstrokesArray . set ( i , strike . n ) ; } return n ; }
2006-10-23T17:59:39,18.415434,-93.480526,-26.8,1
2006 - 10 - 23T17 : 59 : 39 18 . 415434 - 93 . 480526 - 26 . 8 1