large « text file « Java I/O Q&A





1. paging through a very large text file    stackoverflow.com

I need to implement a paging widget that would be able to read an arbitrarily large text file. widget will be used by different apps with a wide range of hardware ...

2. How to deal with a very large text file?    stackoverflow.com

I'm currently writing something that needs to handle very large text files (a few GiB at least). What's needed here (and this is fixed) is:

  • CSV-based, following RFC 4180 with the exception ...

3. How to read a large text file line by line in java    stackoverflow.com

I need to read a large text file of around 5-6 GB line by line in java. Please advice. Thanks, Manoj

4. Reading Large Text File    stackoverflow.com

i am currently encounter a problem reading a relatively huge text file using java 1.4. i am trying to read a text file with 100 character per line and the file can ...

5. How to compare large text files?    stackoverflow.com

I have a general question on your opinion about my "technique". There are 2 textfiles (file_1 and file_2) that need to be compared to each other. Both are very huge (3-4 gigabytes, ...

6. What's the most efficient way to write large text file in java?    stackoverflow.com

I'm trying to write a file with some amount of data using this:

public static <T extends SomeClass> void writeFile(String buffer, Class<T> clazz, int fileNumber) {
    String fileType = ...

7. large txt files , and buffer size....    coderanch.com

hey everyone , i have in my job a 300Mb text file , which i have to do an "insert" statement via jdbc on Oracle7 ,the job is preformed automatically. i just wanted to know what is the best way to read the file , which buffer size i should use,and where should i be carefull... is it basically ok to ...

8. Reading large text files with multiple data types and items.    coderanch.com

I am working on a project that reads data from text files. Every line in a the file corresponds to different data items. Data is pipe delimited. I need to read each line and find out which table it maps to and then insert records into that table. I need to automatically pick the files from a particular directory(whenever the file ...

9. Performance issue on parsing large text file    coderanch.com

Hi everybody, I am going to parse large text files periodically and do some operations them. Algorithm is simple, parsing line by line and comparing lines in another text file (somehow similar to diff operation in Unix). I have completed it by Java but performance is not acceptable. I have heard that some scripting languages (such as Jython and Perl) might ...





10. Searching a large text file...    coderanch.com

Hi all, This was a question asked in a job interview. What is the best way to search the number of occurances of a string in a very large text file (>1 gb) assuming that we must use a Java program. I am sure that the usual String.indexOf() will be very inefficient. Considering the size of file, I feel it will ...

11. Reading large txt files    coderanch.com

It isn't fair to ask me to comment on things that you read somewhere else, especially without posting a link to those things. However, the only things that are put into Java's string pool are compile-time string constants and strings for which the intern() method has been called. So that's irrelevant to reading data from files. Unless (a definite possibility) what ...

12. how many lines in a large text file?    coderanch.com

A situation has come up where I need to know the number of lines in a large log file (50MB, 750K lines, could be much larger). I'm currently doing something like: LineNumberReader lnr = new LineNumberReader(new FileReader(someFile)) ; int totalLines ; for( ;; ) { if ( lnr.readLine() == null ) { totalLines = lnr.getLineNumber() ; lnr.close(); break; } } System.out.println(totalLines ...

13. searching a large text file >1gb    coderanch.com

You'll need to be a bit more specific. A simple way to search a text file of arbitrary size is to simply step through it looking for a keyword. If you're getting an exception due to being out of memory, you have a memory leak somewhere, or are trying to read through the whole file at once. For any operation, you ...

15. Reading a large text file    coderanch.com

Hi, I want to read from a .htm file (around 800KB, 18000 lines) and store the text in a String object. The code follows: import java.io.*; import java.util.*; class A { public static void main(String[] args) throws Exception { FileReader file = new FileReader("/Users/venu/work/DiffUtil/diff_util/tc/a.htm"); BufferedReader BRFile = new BufferedReader(file); String line = ""; // this holds lower case of the text ...

16. reading/streaming a very large text file    forums.oracle.com

hi guys i have a text file. 25mb. just simple lines of text. (it is a generated report). i need to develop an applet which loads (say) 80 lines into memory (retrieving the file data from a url/urlConnection) and displays (say) 20 in a scrollpane. when the user scrolls all the way to the bottom, i need to fetch the next ...





17. Very large text file    forums.oracle.com

I have a text file with 65000 x 3 lines. Actually i load it using one Object for each 3 lines. Each line is saved in one string variable of that object. The aim is to show them to the clients once a time randomly, and once all are showed, restart from beginning. So i used a random function and 2 ...

18. Have a very large text file, and need to read lines in the middle.    forums.oracle.com

I have very large txt files (around several hundred megabytes), and I want to be able to skip and read specific lines. More specifically, say the file looks like: scan 1 scan 2 scan 3 .. .. .. scan 100,000 I want to be able to skip move the filereader immediately to scan 50,000, rather than having to read through scan ...

19. Parse large (2GB) text file    forums.oracle.com

Hi all, I would like your expert tips on efficient ways (speed and memory considerations) for parsing large text files (~2GB) in Java. Specifically, the text files in hand contain mobility traces that I need to process. Traces have a predefined format, and each trace is given on a new line in the text file. To obtain the attribues of each ...