• Post Reply Bookmark Topic Watch Topic
  • New Topic

Urgent Help Required Pls!!!! how to extract date from file.  RSS feed

 
Ahsan Hadi
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me see if I can put this specification correctly, I like to extract a date value and some text by reading lines from a text file. I want to start reading the line from a specfied position and read upto a certain position. Like the substring funtion and convert the string into a data value, then do some calculation with that date value.
Secondly what to do if I need to make this as an application which is running all the time on my PC and only crops up or bring up a dialogue box what a certain condition is met, e.g. if the date value is less sysdate-5.
Do i need to use jframe, jdialogue etc. to make the application.
Your help will be very appreciated.
regards.
[ January 20, 2003: Message edited by: Syed Ahsan ]
[ January 21, 2003: Message edited by: Ahs Hadi ]
 
Ahsan Hadi
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I am not getting much response on this forum so i will try and move this thread to a different forum. see if i can get some luck.
 
Jon Dornback
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try looking at the java.io classes, specifically FileReader and BufferedReader to read in lines from a file. There are methods to read up to a new line, or a specific number of bytes.
For converting text to a date, look up the SimpleDateFormat class. You can define what format the date is in, and it will read a String and convert it to a Date.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!