au.csiro.netcdf
Class NcCSVExtract

java.lang.Object
  extended by au.csiro.netcdf.NcCSVExtract
All Implemented Interfaces:
Command

public class NcCSVExtract
extends Object
implements Command

The ncextractcsv command reads a specified column of data from a comma separated file and then writes this column to standard output.
Copyright 2010, CSIRO Australia All rights reserved.

Version:
$Revision: 84 $ $Date: 2010-08-25 15:56:46 +1000 (Wed, 25 Aug 2010) $ $Id: CSVExtract.java 6525 2010-03-17 23:39:33Z che256 $
Author:
$Author: robertbridle $ on 18/03/2010

Field Summary
static String COLUMN_INDEX
          The name of the command line option used for specifying the index of the column.
static String END_ROW
          The name of the command line option used for specifying the end row.
static String EXTRACT_COMMAND_NAME
          The command name
static String INPUT_FILE
          The name of the command line option used for specifying the input csv file name.
static String START_ROW
          The name of the command line option used for specifying the start row.
 
Fields inherited from interface au.csiro.netcdf.cli.Command
MAX_32BIT_OFFSET_FILE_SIZE, PRINT_WIDTH
 
Constructor Summary
NcCSVExtract()
          Constructor
 
Method Summary
 org.apache.commons.cli.Options createOptions()
          Create the command line options for this CSVExtract command.
 void execute(String[] args)
          Run the CSVExtract command.
 String getCommandName()
           
 String getUsageString()
           
 String validCommand(String[] commandLine)
          Determine if this command is valid, check its syntax.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTRACT_COMMAND_NAME

public static final String EXTRACT_COMMAND_NAME
The command name

See Also:
Constant Field Values

INPUT_FILE

public static final String INPUT_FILE
The name of the command line option used for specifying the input csv file name.

See Also:
Constant Field Values

COLUMN_INDEX

public static final String COLUMN_INDEX
The name of the command line option used for specifying the index of the column.

See Also:
Constant Field Values

START_ROW

public static final String START_ROW
The name of the command line option used for specifying the start row.

See Also:
Constant Field Values

END_ROW

public static final String END_ROW
The name of the command line option used for specifying the end row.

See Also:
Constant Field Values
Constructor Detail

NcCSVExtract

public NcCSVExtract()
Constructor

Method Detail

createOptions

public org.apache.commons.cli.Options createOptions()
Create the command line options for this CSVExtract command.

Specified by:
createOptions in interface Command
Returns:
the command line options for this command.

execute

public void execute(String[] args)
             throws org.apache.commons.cli.ParseException,
                    IOException
Run the CSVExtract command.

Specified by:
execute in interface Command
Parameters:
args - command line arguments.
Throws:
org.apache.commons.cli.ParseException - thrown if the command line arguments can not be parsed.
IOException - thrown if netCDF can to be written to or read from.

getCommandName

public String getCommandName()
Specified by:
getCommandName in interface Command
Returns:
the command name for this command.

validCommand

public String validCommand(String[] commandLine)
Determine if this command is valid, check its syntax. Required options: inputFileName, columnIndex Type check: columnIndex, startRow, endRow can only be integer

Specified by:
validCommand in interface Command
Parameters:
commandLine - command line arguments.
Returns:
error if found.

getUsageString

public String getUsageString()
Specified by:
getUsageString in interface Command
Returns:
the usage for this command.


Copyright © 2010. All Rights Reserved.