Results 1 to 7 of 7

Thread: need some help

  1. #1
    mahoraz is offline Member
    Join Date
    Jul 2011
    Posts
    5
    Rep Power
    0

    Default need some help

    still fairly new to java

    i need help with a sort of CLI where different input output can be methods like CSV, MySql, console and so on in form of
    <program> -<input-method> [input-parameters] -<output-method> [output-parameters]
    can anyone give me a quick example on how this can be coded (i read something about bean class)

    second question goes towards reading from CSV. When i have the known header for the file as preset for every file (identical header for every input file) but the file itself does not have the header.... can i read them directly using predefined header or do i need to read in the file and rewrite it back with the header and then read it again?

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,562
    Rep Power
    25

    Default

    How does your question relate to java programming?

  3. #3
    mahoraz is offline Member
    Join Date
    Jul 2011
    Posts
    5
    Rep Power
    0

    Default

    as in how exactly is this implemented in java as i only know C

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,562
    Rep Power
    25

    Default

    Ok, then I guess its time for you to learn java if you need to write an application in java.

    If you have any specific java coding questions, please ask them.

  5. #5
    mahoraz is offline Member
    Join Date
    Jul 2011
    Posts
    5
    Rep Power
    0

    Default

    ......

    i was asking on how to implement command line methods and parameters that are used upon execution of a program.... for example in formats such as
    ../myfile.jar -db 2 -html /tmp/myfile.html
    ../myfile.jar -csv my_input.csv -console

    to designate the input and output methods and paths... in C they are captured by the main as input variables/parameters but i have no idea how its done in java

    and can csv framefork be used to read csv files that have no header in them but is pre defined in the code
    Last edited by mahoraz; 07-13-2011 at 02:37 PM.

  6. #6
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,562
    Rep Power
    25

    Default

    how to implement command line methods and parameters
    In java the command line arguments are passed to the main method in a String array. main() is defined as:
    public static void main(String[] args) { ...
    The args array has the arguments from the command line.

  7. #7
    mahoraz is offline Member
    Join Date
    Jul 2011
    Posts
    5
    Rep Power
    0

    Default

    ok now i get it... after that just chop check and match the args string and redirect as needed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •