Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Store Data in a file in psv(pipe seperated value) format

 
Ramesh Kanuri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please help me in a scenario that my requirement is to store some id(containing multiple date values)s in the file in PSV format.

Please give me the solution for this query.


Regards,
Ramesh K
 
todd runstein
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmmm. A PSV file is .... a file. Treat it as text, not a database. Use the File, StringTokenizer/Scanner classes and you should be good.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65653
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the relation to JDBC?
 
todd runstein
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the relation to JDBC?


In my opinion, there isn't any - or rather, there shouldn't be any - unless you're trying to really overcomplicate things. On the other hand, I've seen JDBC drivers that work with CSV files, so it's certainly possible.
 
Rusty Smythe
Ranch Hand
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ramesh Kanuri:
store some id(containing multiple date values)s in the file in PSV format.


If I understand you, you want to take some date values, e.g.,

2006-07-22
2006-08-10
2006-08-13
(etc)

And put them in a file as:
2006-07-22|2006-08-10|2006-08-13|(etc)

Is that right?
- If so, how many dates per line?
- How many dates total?
- What are you going to do with this file? (there may be a better way to do it than you think)

If not, please post an example of what you're trying to do.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!