| Author |
Reading different file extensions
|
Matthew Middleton
Greenhorn
Joined: May 05, 2004
Posts: 23
|
|
Ok, I was just wondering what all file extensions that you could read in java. I just bought a new organizer and it can import/export different files such as the to do list/schedule/phone book, but it's only for back up, I wanted to see if I could write a program to open the file and interpret the file so I could read it on my computer and maybe modify it. The files are saved as .csv. Is this possible, can i just read the file like I would a regular text file?? If not how would you do this?? Thank you for your time and GOD Bless. Matthew Middleton
|
 |
Blake Minghelli
Ranch Hand
Joined: Sep 13, 2002
Posts: 331
|
|
Yes, you can read any file in Java, you just need to know how to read it, i.e. how is the data stored in the file. File extensions do nothing magical - they just give a hint to whatever program you are using as to how to read the data. For example, if you have MS Word installed, then Windows associates .doc to Word and uses it to open that type of file. As long as your program knows what format the data is in, then the extension can be anything. You could have files that store ascii text and use a .foobar extension. The point is - using Java, you can read any type of file; Your program just needs to know what format it's in to do anything useful, like displaying the data in a gui. Since a .csv is normally just a comma-delimited ascii text file, then you can simply use a java.io.BufferedReader or some other character-based Reader.
|
Blake Minghelli<br />SCWCD<br /> <br />"I'd put a quote here but I'm a non-conformist"
|
 |
 |
|
|
subject: Reading different file extensions
|
|
|