read 4 « Operation « Java I/O Q&A





1. Need a solution to read and store data from a file    coderanch.com

Hii everyone..I an new to this forum, I have registered today. I want to know how to store the input values which are read from a file. The input values are all double values in a line separated by spaces. I want to read these values one after the other and store in a double typed variable. For example: The input ...

2. Problems Reading UTF-8 File    coderanch.com

Hi guys I need clarify this issue I am working with the SunFtpClient Class in a project that involve download file contents from Ftp server on Unix Machine. I create some Files in notepad, write the content and then I save as UTF-8 encoding. Next I transfer the file content from my machine to the ftp server in binary mode. Here ...

3. when reading a file, how safe is using ready() method in the loop.    coderanch.com

..Tells whether this stream is ready to be read. A buffered character stream is ready if the buffer is not empty, or if the underlying character stream is ready. Returns: Returns true if the next read() is guaranteed not to block for input, false otherwise. Note that returning false does not guarantee that the next read will block.

4. Reading from a file    coderanch.com

Hi all, I have data in a text file as the below format, name string 20 city string 20 address string 20 age int DOB date id int I want to read the information from this file as name city address age DOB id I mean I want only the first column... How to get this information from the text file. ...

5. how to read content of a site?    coderanch.com

I found following code to read content (HTML) of any page of any site: public static void main(String[] args) throws Exception { // URL url = new URL("http://64.233.167.104"); URL url = new URL("http://www.google.co.in"); URLConnection urlconnection = url.openConnection(); // urlconnection.setUseCaches ( false ); InputStream is = urlconnection.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader bufRead = new BufferedReader(isr); String aLine = null; do ...

6. Reading and using numerous files at once    coderanch.com

I realise this question may have been asked before, but i need help in the context if my code. I have an application which lets the user name a file which contains their timetable and it is then saved in a timetables folder. e.g CorkToDublin.Txt. Each timetable has it's own .Txt file. Each timetable contains 5 values which are written from ...

7. Read BACK in a file    coderanch.com

I have a requirement where I need to display data persisted in a file (a BIG file with millions of records) on the UI in a JTable. I have a FileHandler class which does the actual file IO. The custom table model will query this class for the getValueAt() method. When the user scrolls down, the model queries the FileHandler which ...

8. why int as return type in read() not char.    coderanch.com

public int read() throws IOException; read() in java.io.Reader returns int, and to print it we have to cast it to char. why not this method can have return type char instead of int. one point can be it returns -1 in case no char exist thats why it returns int, but that can not be a sole reason as it leads ...

9. i want to read a file which has been created by Star Office    coderanch.com

I have created file by OpenOffice .org and i want to read the content of the file through the program.i am able to read text file and .doc file what is the difference between office tools and star office and how i should read the file that has created by openoffice. Please can any one help me





10. Reading Data from Simulator    coderanch.com

Hi Everyone I am using a TOF(Ticket Output Feed) Simulator. This is a simulator (in the form of simple exe which can run on a system)which generates the deal in the same way as a reuter server. With the help of simple Java simple Client program I am able to connect to it but i am unable to get the deals ...

11. problem while reading a file    coderanch.com

12. how to read a file    coderanch.com

13. Read the machine Guide    coderanch.com

I want to read the machine guide for a specific need of the product. I've found that its located in "SOFTWARE\Microsoft\Cryptography\MachineGuid". Which requires to read the registry if I've to get the string. I've found one of the way to read registry, i.e. by using java.util.prefs.Preferences, but I'm unable to get value from the specified node as it is reading values ...

14. How to seek start and end pointers without reading a file    coderanch.com

Hi one and all, I want to replace text between start and end pointer in a File. But without reading a file.File size is big.it takes more time. So i want to replace text with new data between start and end pointers without reading file. is there any way to do ? please let me know . Thanks in Advance.

16. Reading a file    coderanch.com

Hi, Say theres one file of X MB and I want to read it entirely and display the decimal value represented by these X MB of data. Can anyone guide me how to begin with. [By decimal value I mean : all bits finally represent something in decimal; How can I convert X MegaBits to Deciaml value and perform arithmetic operations ...





17. how to read a unix compressed file?    coderanch.com

I don't believe there's a stock Java class to read .Z files created by the Unix "compress" program. Compress has been largely supplanted by gzip anymore - I believe that it was disqualified from inclusion in Linux due to licensing restrictions. Someone holds a patent on the algorithm or something like that. Although a little googling makes me suspect that some ...

18. Reading CAD Files    coderanch.com

19. how to reset the pointer to begining again after read through the file?    coderanch.com

I tried fileInputStream.reset(), it throws exception says the "mark/reset not supported". I need to read the file into a byte array, first I have to use a while loop while ( (currentByte = fin.read() ) != -1) { fileLength ++; } to count how many bytes of the file, then using the counter to new a byte array, then use fin.read(array,0,array.length); ...

20. Efficient File Reading    coderanch.com

Hello We have an application that runs on PC. It reads a input file with half million records and loads them into cache (EHCACHE), before the user work on it. Currently its taking 5 minutes to do this operation. I am just wondering if there is more efficient way to read and load into cache. (may be using streams than readers ...

21. Reading a complex file    coderanch.com

Hi, I have a file(*.txt) which is of the format: content1 content2 ...Etc till... contentN {1 : Data1}{2 : Data2.. ...Etc till.... } What would be a optimal way of reading the same? Would a plain buffered stream read suffice OR a better alternative exist. Cheers, Amit [ December 16, 2006: Message edited by: amit bose ]

22. Problem in reading macros of Exel file    coderanch.com

Hi all, i am using POI API for reading the Excel data . but in excel file contains some macros, list box buttons that is why i m facing some problem in reading that. i installed newer version of poi api 3.0 but i m getting problem in reading that. i m getting this execption org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance ...

23. Reading a file that has .ODT extension    coderanch.com

24. java api for reading Adobe Framemaker files    coderanch.com

Hi All, i need some help for reading adobe frame maker file. do any know any idea about java api or any thrid party api for reading Adobe Frame Maker files, i gooled in net, but i didn't get any help, any have any idea about this, please help me. I want read Frame Maker header inforamtion. Thanks.

25. Reading local file    coderanch.com

26. directories/file reading    coderanch.com

hi all, i just wrote something to read all files in a specific dir.works fine. now i made something where the user can create new sub-dirs in this dir.werks,2.so when i readout the main dir, the reading routine shows me the subdirs as files,2. now i need to differ if its a file or a new dir, and when i click ...

27. Reading file from LAN    coderanch.com

29. Reading file    coderanch.com

30. Reading file from client machine    coderanch.com

Yes Indeed. From Fileupload Using Guide "With uploaded files, you generally will not want to access them via memory, unless they are small, or unless you have no other alternative. Rather, you will want to process the content as a stream, or write the entire file to its ultimate location. FileUpload provides simple means of accomplishing both of these. // Process ...

31. Reading File    coderanch.com

32. read a file at local Client    coderanch.com

33. Reading Multiple files by single submit    coderanch.com

My requirement is to upload multiple filesto server then process these files. I am able to do it with one file my coding is below. index.jsp ------------

What is your name?
Which file do you want to upload?
UploadTest.java ---------- import java.io.*; ...

34. Reading strings from file    coderanch.com

I am writing a small file processing application. It reads a file consisting of a set of lines each of which have the same format - say a string followed by a number followed by a boolean (for example "this is a string" 123 true). How can I process the file such that I get the String, int, boolean one after ...

35. Reading different file extensions    coderanch.com

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 ...

36. reading the file properties in English    coderanch.com

hi my requirement is to know all the properties of a file. for this i have written this code shown below, but it writes the data(properties of a file) in BINARY in the Images.ini file Properties p1 = new Properties(); FileInputStream fp1 = new FileInputStream("c:\cricket.txt"); p1.load(fp1); Enumeration myenum = p1.propertyNames(); PrintWriter pw = new PrintWriter(new FileWriter("ImagesA.ini")); p1.list(pw); pw.close(); fp1 = null; ...

37. read a file ?    coderanch.com

Hi all, I am trying to develop a small application. I have a set of questions in a file and i need to read these from the file, as question by question an dneed to display them on the screen at the same time. I? am quite new to this. Can someone please help.

38. Read data from file !    coderanch.com

Hi all, I want to read data from file. I want to read 1 line at a time from file. But i dont know how to do it, i only can read with the size of buffer. this is my code : public void readFile(String filename){ try{ // try to start reading Reader in = new FileReader(filename); char[] buff = new ...

39. reading from a file    coderanch.com

I have a txt file which stores timetable data in this format: flightnumber, departuredate, departuretime, avaliableseats so, at the moment the file looks like this: 001, 01.01.05, 09.00, 10 I need to read in this data and then display it. At the moment my code to do this looks like this: string timetableString = null; try { FileReader fin = new ...

40. Reading and displaying Strings from a file    coderanch.com

I have 2 different sets of code below which yield different results for the same input. Though I understand the flow, I would like a more "Formalized/Academic" description of whats happening ... THE INPUT FILE "income.txt"(contains the following 3 strings as they appear i.e on 3 diff lines): This is Test1 This is Test2 This is Test3 The first code : ...

41. reading from nsf files    coderanch.com

If you import the lotus.domino package into your java file -- which (assuming you have Notes installed) you should be able to do by adding the location of Notes.jar to your CLASSPATH -- then you should be able to use these classes to represent nsf elements (views, documents, etc.) as Java objects. In Lotus Domino Designer Help, see the topics "Running ...

42. Read a file from the client    coderanch.com

Hi, I have a web-application that is used in a company. I want to read a file from the client in my application, to use this as a(default) text in an email. But it seems to be inpossible to read a file from a client. Can someone tell me if it can be done (and how)? Thanx!

43. Reading a propeties file from a Java Client    coderanch.com

Hello, I have a web application in which I have a properties file under WEB-INF/classes folder I am able to access this properties file from a Servlet using servletContext.getResourceAsStream but I also need access to this properties file from a Java Client .. this Java Client is triggered by Quartz .. any idea? Your help is highly apprecited!

44. reading from a unix file and calculating pages    coderanch.com

Hi, I need to read a Linux file that contains account statements that has a delimiting field and calculate the number of pages that each statement contains and then present the totals for 1,2,3,4,5.... I am presently using a filereader and indexOf. readLine(). any help is appreciated. the code is listed below. import java.io.*; import java.util.*; public class IDT_LOTSTREAM{ StreamTokenizer pages ...

45. How to Read the Time Stamp of a File    coderanch.com

Hi all, I would like to develop a code which should be able to Retrieve the Time Stamps of the LOg Files(8-10) files and it needs to check that time stamp with the current Time stamp and if it is Less than a defined Limit it needs to Write a Error Log if not needs to Write a Success S.O.P stating ...

46. Best way to read a remote file    coderanch.com

47. reading in files    coderanch.com

I am writing a region grow program that will count the number of connected 'on' pixels to give me the size of a region. To do this I need to read in a binary bitmap file and get access to the on off pixels. Does anyone have any idea how to read in a binary bitmap file? or additionally any tips ...

48. Reading in a file    coderanch.com

I have to read in a file that will be be given at run time but everytime i run the program it hangs. I mean it runs and runs and runs but is doing nothing. Here is the code. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; public class ClassBuilder { public ClassBuilder() { toString(); } public static String getInteractiveInfo() { ...

50. how long this file need to read it??    coderanch.com

You might be able to give an aprox. value if you know the size of the file and the time it takes to read a char/line. The size, i.e. number of bytes, of the file can easily be retrived (see File API). The time it takes to read a byte can only be an aproximation (please correct me if I am ...

51. reading variable block file    coderanch.com

Hi, I have a variable block file which was transmitted from mainframe side. When i browse the variable block file in mainframe i can see it as !Line 1 !Line 2 !Line 3 but once we transmit the file in Unix box, the file contents appear as !Line1!Line2!Line3 does java differentiate between variable block and fixed block files.. does java has ...

52. Reading .pst file    coderanch.com

53. reading .WMV files through Java    coderanch.com

How much experience do you have with reading binary file formats? If sufficient, you might find it easiest (and most optimised) to write code to directly examine the ASF headers in the file. The ASF format is available openly from Microsoft here: http://www.microsoft.com/windows/windowsmedia/forpros/format/asfspec.aspx They technically stipulate that if you implement any of the spec. you must also implement all mandatory sections, ...

54. Reading File Headers    coderanch.com

Good afternoon, So I was wondering how you read headers in Java (assuming you know the spec for the header.) Now in C I would have just read the number of bytes in the header into a buffer, and and changed the pointer reference to the chunk of memory to point to a strut that was a representation of the head. ...

55. reading a file record by record    coderanch.com

I have a requirement of reading a file record by record so this would be a text file being built from mainframe data. I have to read it and display all column information with proper heading. I want to know - what should be the best approach to read a file which doesn't contain just raw data but it contains records ...

56. Any good marking mechanism when reading in items from a file?    coderanch.com

Hi all: I have a txt file full of job ids, i need to do some processing with each id. After each id is done, I need to cross it off because if my tool crashes for some reason, I do not want to restart the jobs that have already been processed.. Any good suggestions on how to do this?

57. Query! Reading last modified/latest file    coderanch.com

Hi All, I am a new bie in java, I having a very small doubt, I ant ot know how I can read the lats modified file in java. In one program I have created one file with a time stamp attached to it. say Test.txt2007-12-06 20:08:14, now in another program I want ot read the latest/last modified file. Can anybody ...

58. Read in file    coderanch.com

Howdie: I have issues with this program: package Scores; import java.io.*; import java.util.*; import java.util.Scanner.*; public class Scores { public static void main(String[] args) throws Exception { int total=0; int count=0; // Create a File instance java.io.File file = new java.io.File("Scores.txt"); // Create a Scanner for the file java.util.Scanner input = new java.util.Scanner(file); // Read data from a file while (input.hasNext()) ...

59. unable to read file header    coderanch.com

hi all , my problem is related with file Header in my jsp application i am uploading excel sheet using "apache.poi" for validation when i m open & chek file it work fine , but next time when i read same file again ..... then following exception occur ..... ------------------------------------------------------------------------------------- Unable to read entire header; 0 bytes read; expected 512 bytes ...

60. How to read a file from remote System    coderanch.com

There are many ways to do this. Depends on what software in running on the server and on the client. Perhaps you could explain about that. On the server what services such as JSP or CGI to handle the verification. On the client, would there be a browser to read an HTML page and send

61. Can I read a file chunks in parallel?    coderanch.com

Hi all, After long time.. I have huge file (about 500k fixed size records or more). I wanted to know if I can read it in parallel via different threads. I have not used Java NIO packages yet! (sounds strange, but it is true). Is there a way we can read the file in parallel using any of the NIO concepts? ...

62. reading in files    coderanch.com

FileReader has a method called skip(long n) which allows you to skip n bytes of data. BufferedReader has a method called readLine(). You could use this method within a loop but this still read each line so that may not be what you want. There is also a class called LineReader which would allow you to set the line number ( ...

63. reading files    coderanch.com

64. Read file from package    coderanch.com

65. Reading in a File    coderanch.com

66. help needed with file reading in program.    coderanch.com

Hi all, I am a beginner on posting messages and also on JAVA so please excuse the conventions. I am having a problem reading a file .... PROGRAM: ------- public class mod { public static void main(String[] args) { TextFileIn f = new TextFileIn("bigfile.txt"); int numLines = 0; boolean done = false; while(!done) { String s = f.readline(); if (s == ...

67. Fastest File Read Method    coderanch.com

I am reading from a file and printing it to a screen. Currently I do this: FileInputStream inp = new FileInputStream( filename ); DataInputStream theHTML = new DataInputStream( inp ); char thisChar; String theFile = ""; while (true) { try { thisChar = (char) theHTML.readByte(); theFile = theFile + thisChar; } catch (Exception E) { break; } } out.print(theFile); ********************************* What ...

68. Reading from a file    coderanch.com

Hi everyone. (I did post this in IO, but no luck there.) I am reading a flat file in this format KID|AG01|Anteneh|Gebreal|OG|19961128|Pig|A* KID|AC02|Aurakeasamy|Carmine|OG|19960519|Square|A* KID|BA03|Beukman|Ashley|OG|19960711|Star|A* KID|BE04|Bihl|Elrique|OG|19951229|Teapot|A* KID|CH05|Chauhan|Harsheel|OG|19960812|Robot|A* KID|CD06|Chipaka|Danteek|OG|19960514|Seal|A* KID|DS07|Davies|Sandile|OG|19960828|Triangle|A* KID|DS08|de Assuncao|Sergia|MG|19970206|Iron|A* Unfortunately I can only get it back in char format, how can i get a string for each line, iterating? I can then us a stringtokenizer to break it up for ...

69. Reading files within packages...    coderanch.com

Now that I have my application successfully broken out into packages, I have run into a small problem. Before, when I had all my classes in the same directory and no packages, I also had in this directory a .properties file. Only on eclass needs access to this file, so when I created my packages I moved this file to the ...

70. problem in reading from file    coderanch.com

The avilable() method does not necessarily give you all the bytes that are in a file; it gives you the number of bytes that at available at that moment (without waiting). For various reasons, the whole contents of a file may not be available for reading all at once. Maybe the file is fragmented into several pieces at different locations on ...

71. Help: Read file, get #, set arry size, display #s,etc.    coderanch.com

Ok, here is the deal. I am getting ready for a test and trying to practice stuff, so the prof. gave me a lab. It is supposed to basically use a filename as a command line argument, read the #s in, and print them out in a neat 5 column style. The #s are supposed to be sorted first, lowest to ...

72. Confused with file read    coderanch.com

Hey yall, my assignment this week is to Implement a class named Course with Data members: String name and students (array of 30 Student representing students in the course) and int size, which represents the current number of students in the course I am supposed to read data from a filename, create respective students then add to the array student. Each ...

73. Reading file with various object    coderanch.com

74. How to read data from a file...    coderanch.com

I am at a lost as to where to begin... I need to read data from a file (Example: 2c 4h 5d 9s) then according to what letter is next to the number, I place in the proper array spot. (So I am guessing multi-dimensional array?) Umm... data is 13 'couplets' and I am at a total loss of where to ...

75. Reading from file    coderanch.com

Hi Marc, in.read() returns an int - the character code of the char you read. You need to cast this to a char when printing out. With minimal changes to your code, this works: import java.io.*; public class A { public static void main(String[] args) throws IOException { File inputFile = new File("C:\\SQL.txt"); File outputFile = new File("C:\\SQL2.txt"); FileReader in = ...

76. help reading in file of integers    coderanch.com

77. cannot read file..    coderanch.com

Hi there, Is your class in a package? I run your code (except the part that you dont include), and I did initially get a FileNotFoundException (by the way, the catch clause would catch anything, it might be a good idea at least to print the stack trace of the exception...) when I first tried to run it. The problem was ...

78. much trouble reading files    coderanch.com

To start, you should be using paintComponent() instead of paint(). You're trying to draw lines (from point to point) to represent a map of the usa (rather than print an image of the usa)? if so, read in your points to an array (if number of points is known) or to an arraylist, pass the array/list to the panel, then draw ...

79. reading an integer from a file    coderanch.com

Why i'm i getting this errors? Java.io.FileNotFoundException:File.dat(The system cannot find the file specified ) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:106) at ReadInteger.(ReadInteger.java:27) at TestFile.main(TestFile.java:14) Here's my code: import java.io.*; public class ReadInteger { private File f; private FileInputStream fis; private InputStreamReader isr; private BufferedReader br; final static int maxArrayLength = 100; private int [] xIntegers; private int numOfValues; private double average; private ...

80. Read integers from a file    coderanch.com

I'm trying to read integers from a file (2 integer values separated by whitespace) that the program will use as variables. The following code works correctly. I was wondering, is there an easier method to read integer values from a file and then assign the values to specific variables? try { BufferedReader in = new BufferedReader(new FileReader(filename)); String s = new ...

81. Read from file problems    coderanch.com

Originally posted by Lora Tully: It was part of my task and it had to be a writeByte and readByte. Thats the problem I am having. Is there a way of writing 600 in two bytes then and then reading 2 bytes? If I am remember one byte has 8 bits, so thats 256? so 2bytes would cover 600 but I ...

82. Help reading File    coderanch.com

I have a .txt file with some sentences typed in in this format: Sentence 1 Sentence 2 Sentence 3 Sentence 4 Sentence 5 I can read and show the contents of the file but what the problem is I just want it to show sentences 1 through 3. What do i use for it to recognize the new line? Ive tried ...

83. Reading File contents to a String    coderanch.com

I am trying to read the file contets to a String. Here's the program I have writteen for the same public int countWords(File file) { int ctr = 0; String contents = new String(); String s = new String(); try { FileReader fr = new FileReader(file); BufferedReader br = new BufferedReader(fr); while((s = br.readLine()) != null) { System.out.println("s " +s); contents ...

84. Reading Large Files    coderanch.com

Couple points and then a solution. First, there are approximiately zero reasons to run gc() manually. Second, there are few reasons to read 600 megabytes in to memory in one fell swoop. Use a memory mapped file. http://javaalmanac.com/egs/java.nio/CreateMemMap.html P.S. Make sure you set your memory switches and usually it's a good idea to clamp both ends so that re-sizing at runtime ...

85. File Reading    coderanch.com

Do you have a question? You need to describe your problem! If you are getting errors, copy and paste them here. If you're program is not doing what you want it to, write a description of what it is doing and what you want to change. Include examples and output from the program.

86. reading a section of a file    coderanch.com

Hi guys, Can you please tell me how to read a few lines within a text file? Here is a sample of the file. I want to search the file for the occurence of "CELL CGI" and where this is found I want to read the next 5 lines and write lines 1,3,5 to another file as a single line. I've ...

87. Reading bin files in java?    coderanch.com

88. Can't read a file    coderanch.com

If it is a permissions problem, the "workaround" is to ask the owner of the file to change its permissions so you can read it. But that's probably you, and it probably isn't a permissions problem at all. It is maybe the problem where you don't understand the concept "current working directory". Your code tries to look for the file in ...

89. How do I read an entire file all at once?    coderanch.com

System.out.println(new java.util.Scanner(System.in).findWithinHorizon("(s).*",0)); Use a File in place of System.in (but please note that using Scanner has a limitation that nothing following the last newline is used, so make sure your file contains a newline at the end if you intend to use this method). The dot matches every character except possibly a newline. The (s) removes that exception. The asterisk makes ...

90. reading from file...    coderanch.com

ok i figured out how to read and write to files.... but here is my code. import java.util.Scanner; import java.io.*; public class Read { public static void main (String[]args) { int count = 0; Scanner scan = null; String answer = ""; File file = new File("emp50.txt"); try{ scan = new Scanner(file); } catch(FileNotFoundException e) { System.out.print("Missing File \n"); } while(scan.hasNext()) ...

91. Reading alarge file and wrapping content    coderanch.com

Hello, Have a look at this way: 1) Have Reader Interface with read(), ... etc methods. 2) Create a concrete class for each type of record with Reader implementation. 3) Have Factory which will return a record type based on key. Next, in main or some other method... FileStream List For all Records { Record record=RecordFactory.getRecord(Type); record.read(FileStream); listofRecords.add(record); } Now ...

92. problem with file reading    coderanch.com

I have a problem when reading information from file. I have for example such a structure of file1: Lastname \t Adress \t WorkName \t Date \t HoursWorked I do the reading like this: try{ while ( (eilute = ds.readLine()) != null) { try { StringTokenizer st = new StringTokenizer(eilute); pavarde = st.nextToken(); adresas = st.nextToken(); darboPavadinimas = st.nextToken(); String strD = ...

93. Read File    coderanch.com

Hello, I'm still fairly new to Java. For our assignment we were to create a shopping list. The specs were to create four classes: --Grocery - contains each item --GList - contains the node based list --InvalidAisleException - for invalid aisles --Testclass Our input file look as follows: 4 (items in the list) milk (item) 4 (aisle) bread 2 eggs 1 ...

94. Reading Files    coderanch.com

Hey, I'm only now noticing how picky the java file readers are. I'm using Scanner to scan a file in code below: Scanner scanner = new Scanner(f).useDelimiter("\n"); while(scanner.hasNext()) { ArrayList lineList = new ArrayList(); lineList.add(scanner.next()); for(String line:lineList) { String[] argumentList = line.split("/"); nodeArgumentsList.add(argumentList[0]); transitionArgumentsList.add(argumentList[1]); } } And the format for the file is: 0:true:true/a-1:b-2:c-0 1:false:true/a-2:b-2:c-1 2:false:true/a-1:b-0:c-2 But unless I'm very specific ...

95. Problem reading from file    coderanch.com

public Hybelhus(String fil) { //les HaiHus.data int x = 0; int y = 0; System.out.println("Leser fra fil HaiHus.data"); while (!innfil.endOfFile()) { int gangnr = innfil.inInt(); //<---- Hybelhus.java:34) int hybelnr = innfil.inInt(); String leietager = innfil.inLine(); int utestaaende = innfil.inInt(); firsttime = false; x ++; if (x >= 8) { x = 0; y ++; hybelnr ++; } Hybel nyhybel = new ...

96. Counting chars during file read.    coderanch.com

I would like some help on 2 issues with my program the first is counting the chars of each line and the second issue is recording the frequency of how many times each letter appers in the file. I want to store the number of times each letter of the alphabet appears in the txt file: A=12 B=9 .... Z=1 but ...

97. How to read Java Script file in simple java    coderanch.com

The JavaScript file is just a plain text file. You could simply read the file line by line. Finding comments could simply be done with String.indexOf(), or with regular expressions. You'd probably need to be a little bit more sophisticated than just search for /* or //, because those characters could also appear inside a JavaScript string literal, in which case ...

98. Reading a file in reverse order    coderanch.com

99. How do i read .ldif file through java?    coderanch.com

100. how to read a gsm file in java    coderanch.com

You didn't say what kind of file this is, but I'm assuming that it is a binary file, not a text file. So you can't keep it in a string (unless you want to use base-64 encoding or some such), but instead you need to use a byte[]. The corresponding DB type would be a BLOB.