4 Replies - 769 Views - Last Post: 17 March 2012 - 10:16 AM Rate Topic: -----

#1 ct_hunny  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 17-March 12

question how java read a txt file and calculate the different date txt

Posted 17 March 2012 - 08:06 AM

hello i have some problem is how can i read a date and time that i already set in txt file...and i can calculate different time between it..thank you
Is This A Good Question/Topic? 0
  • +

Replies To: question how java read a txt file and calculate the different date txt

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5676
  • View blog
  • Posts: 12,199
  • Joined: 02-June 10

Re: question how java read a txt file and calculate the different date txt

Posted 17 March 2012 - 08:24 AM

What have to you tried to code so far? - Click the link

90% or more of the problems we see here on homwork assignments is because students don't stop and plan nor block out their code into logical segments.
Read this article to get started on the right foot:
This is the 'Help me with my homework' article you wanted.



What part of what you have tried isn't working?
Are you getting error messages, or is it just not giving you the results you wanted?

(In other words, you at least have to make and show us your good faith effort to do your own coding. We are here to help you, not do it for you.)
What does this error mean?

Suggestion:
Don't replace lines of code that don't work. Instead comment them out and put your new attemps below that. This will keep you from re-trying the same ideas over and over. Also, when you come back to us saying "I've tried this 100 different ways and still can't get it", we can actually see what you tried. So often a failed attempt is very very close and just needs a little nudge in the right direction. So if we can say "See what you did in attempt 3... blah blah" it helps a lot

// Try #1 - May 1, 0900hrs
//    code
//    code  
//    code
// Try #2 - May 2, 1700hrs   Okay, plan B.  What if I do it *this* way
//    code
//    code  
//    code
// Try #14 - May 3, 0500hrs after 5 cans of RedBull.  Maybe I should get some sleep. I can't think of anything else but this last idea
    code
    code  
    code


If you are using Visual Studio you can select a block of lines and hit control+k control+c (Kode Comment) to comment it out. control+k control+u (Kode Uncomment) to uncomment a selected block.

These articles may also apply:
Stages of asking for homework help on a forum.
I don't want you to write my code, just give me ideas on how to solve my problem. - Read this article
How NOT to go about your assignment
"It doesn't work" isn't good enough - How you can help us, to help you
Was This Post Helpful? 0
  • +
  • -

#3 ct_hunny  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 17-March 12

Re: question how java read a txt file and calculate the different date txt

Posted 17 March 2012 - 08:46 AM

actually i have to create a program that can calculate how many one file have been to access my research is about data replication, so firstly i have to calculte how many time file have been access and execute different time between the date accessing from txt since the program i write in C.
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10809
  • View blog
  • Posts: 40,288
  • Joined: 27-December 08

Re: question how java read a txt file and calculate the different date txt

Posted 17 March 2012 - 10:07 AM

Wait- are you writing your program in C or Java? If this is a Java question, you can check out this tutorial on File I/O.
Was This Post Helpful? 0
  • +
  • -

#5 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5676
  • View blog
  • Posts: 12,199
  • Joined: 02-June 10

Re: question how java read a txt file and calculate the different date txt

Posted 17 March 2012 - 10:16 AM

Quote

i have to calculte how many time file have been access

That's going to be a problem. There is no built-in way to just track the number of times a file is accessed by any program on the computer.

You would have to maintain a constant watch of the file's last access date/time and every time it changed your program would have to track that.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1