Results 1 to 3 of 3
  1. #1
    itsnexgen is offline Member
    Join Date
    Sep 2008
    Posts
    9
    Rep Power
    0

    Question Java Project - Parse

    Hi Friends,

    I have been assigned a java based project.

    First based on environment variable values for any type of file extension such as .txt, .doc, .pdf etc. Example: FILE_EXT = .txt

    1. If FILE_EXT .txt
    then all .txt files in folders sub folders with should run a specific commands (such as command 1, command 2 & command 3.) related to .txt. Similarly for .doc (only specific to .doc), .pdf(only specific to .doc) etc.


    2. If FILE_EXT = .html
    then all .html files in folders sub folders with should skip above and run directly command 3.


    In all cases these files will be passed and returned from commands again.

    3. My question would be - how to pass environment variable as arguments and also, parsing for specific extension and running particular command.

    If any of you could help me with some ideas with snippets would be really helpful!

    Thanks,
    Paul
    Last edited by itsnexgen; 06-12-2013 at 09:15 PM.

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,728
    Blog Entries
    7
    Rep Power
    21

    Default Re: Java Project - Parse

    For starters have a look at the File.list(FilenameFilter filter) method.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    itsnexgen is offline Member
    Join Date
    Sep 2008
    Posts
    9
    Rep Power
    0

    Default Re: Java Project - Parse

    Quote Originally Posted by JosAH View Post
    For starters have a look at the File.list(FilenameFilter filter) method.

    kind regards,

    Jos
    Thanks Jos. Yes, parsing i was able to do it.

    These are my queries:
    1. How to pass parameter to commandline
    2. How to parse particular extension within folder and subfolders based on environment variable.
    3. All those files need to be passed to another "command" which converts the files to extension ".convert"
    4. all .convert files are passed to another command which processes and gives a modified ".convert" file.
    5. now after the latest .convert file is recieved, it is passed to another command which converts this .convert file to previous extension which was txt or doc whatever.
    6. Condition here would be if the file environment variable itself was .convert then step2 & step5 will not be done.

    These are requirements which needs to be done which i need guidance to achieve If anyone could explain with examples.

    Thank you!
    Last edited by itsnexgen; 06-13-2013 at 09:45 AM.

Similar Threads

  1. What is parse html in java ?
    By ssnvsr in forum New To Java
    Replies: 1
    Last Post: 05-30-2011, 04:45 PM
  2. Parse .java files
    By axenos in forum Advanced Java
    Replies: 9
    Last Post: 04-22-2011, 05:42 AM
  3. Parse log file using java
    By mvg in forum Advanced Java
    Replies: 0
    Last Post: 07-03-2009, 12:36 PM
  4. Parse EDI File Using java
    By vaskarbasak in forum Advanced Java
    Replies: 6
    Last Post: 09-24-2008, 03:38 PM
  5. How to parse an xml file using java
    By karthik84 in forum XML
    Replies: 4
    Last Post: 09-12-2008, 10:38 AM

Posting Permissions

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