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





1. File reading blues    coderanch.com

Hi ranchers, Here i got some thing strange, i don't know why, but when i am reading a file using FileInputStream, it print some special characters that are not in the file. for example: in the file it is written "Name", But what my program is reading is "N". and some thing with "ame"; not able to show here; as i ...

2. Reading a file    coderanch.com

4. Java.io Read blocking    coderanch.com

Hi , I am experiencing a problem with blocking on read using the the following stream. I don't want to use available() as this is conlicting with the ssl client Can some one suggest how I can solve this where by the read won't block . Any suggestions much appreciated . private TelnetClient client; private BufferedInputStream is; is = new BufferedInputStream(client.getInputStream()); ...

5. Reading a big file(3GB)    coderanch.com

Hi, I have a csv file of size 3GB,i have to read this file and store the file into data base(SQL Server 2008) as stand alone application. But the memory size of my machine is 2GB. So,could anybody help me to how to read this file without exhausting the memory resources. Thanks in advance. Regards Chandra Prakash

6. Dynamically reading a file    coderanch.com

Hello, I have a shell script which populates records in a flat file. I have a java program that has to read in those records and process them. File file = new File("test"); FileInputStream fis = null; BufferedInputStream bis = null; DataInputStream dis = null; String cdr = null; try { fis = new FileInputStream(file); bis = new BufferedInputStream(fis); dis = ...

7. to read intgers into program    coderanch.com

hye, i'm not quite able to figure this out, if someone can help by showing some example code : i wanna enter integers into the variables from console after running program,am unable to do it with readInt(), also the input speciication is a space between integers. which are then taken as row and column of an int array. p.s :pl reply ...

8. Little help with reading files    coderanch.com

Hi I just started my java data structure class this semester and part of my homework is to make a department report. The part where i'm having hard time thinking about is how to read a binary file hoping anyone could give a steer in the right direction to how to read binary files and then inputting that data into a ...

9. Reading a file    coderanch.com

Hi Guys, Iam trying to read a file from a directory as follows: String name = new String(filePath + fileName + ".apr"); File file = new File(name); My problem is that the file extension ".apr" could be in any case(For Example:- "apr","APR","Apr") So my reading of the file fails if the file extension differs from ".apr" to any of the extension ...





11. Reading in alphabetical order    coderanch.com

Hey This is probably a stupid question, but is there any way that I can read in the files in a directary in alphabetical order. This would really help as right now when i read them in they come in in a random order which is not very nice in a display. Thanks.

12. reading smart cards    coderanch.com

13. Reading virus infected file.    coderanch.com

Hi, I have a file which is infected with a virus, my java program opens a fileinputstream to that file and then subsequently loads it into an oracle db as a BLOB using setbinarystream method of preparedstatement, is there any virus threat to my system on which I am doing this activity ? I know that I am not executing the ...

14. how to read non-text files    coderanch.com

15. Weird problem when reading file    coderanch.com

16. Reading data from file    coderanch.com

Hi, I have this scenario, what is the best way to handle this. I receive lots of files from different stores, which holds the store name, address, how can you find distinct addresses? What if the same address is written in different forms (like more spaces added, lower cases, upper cases), then how can you find the distinct addresses? Thanks Oskar ...





17. Combining two files to create a new file and then reading it...    coderanch.com

My Application has two files: 1. An image file and 2. A Java Object that is written(persisted) to another file. I wish to create a single file by combining these two files. And then, (later) re-create the image and the object from this single file. So, I create a FileOutputStream and first write the image to it followed by the object.Something ...

18. Reading files using Pagination    coderanch.com

@ Gabriel: Roseindia has a pretty poor reputation. There are far better resources on the net. @ Monica: I take it you are still trying to solve your memory leak? Absent any framework all you do is decide how many records fit on a page, read that many records from the file and display them (it helps if they are fixed-size ...

19. Reading rar file without extracting it    coderanch.com

Hi , I want to know how to read the archived files with rar extension. I have about 10000 text files. I dont want to extract the file as the text files are very big and i am using winrar 2.9 version. I want just to read the contents of the text file without extracting rar file. Please help me.......... Waiting ...

20. Reading mdl file    coderanch.com

22. Reading large data    coderanch.com

Hi All, I want to read large amount of data (5 Lakh lines of data) from a file within a time limit of 1 Sec. I tried to use buffered reader, but it is taking more than 9 Sec. Is there any other efficient api available in java for reading large amount of data? Thanks in advance.

23. Reading file from bottom in a memory efficient way    coderanch.com

Hi All, I have a file whose maximum size can reach 20Mbs, I have to parse data from this file starting from the end. At present I save it in a StringBuffer, and iterate through it. In each iteration I read the last 2-3 lines, save the data if it is useful and cut the read part away. Can this be ...

24. How to read .cgi file    coderanch.com

You should be able to find some information on that format at the Library of Congress. That looks like a format that has been around a looooong time, possibly dating back to puch cards and teletypes. I suspect you will end up reading the response into multiple Strings, then disecting the strings according to positions within the lines. Bill

25. Help needed in file reading.    coderanch.com

26. How can I read RAF backward?    coderanch.com

27. Issue with reading from a file    coderanch.com

I am trying to create a phonebook program and I am stuck at reading from the file. I have the following method public String Read(){ try { FileReader fr = new FileReader("phones.txt"); BufferedReader br = new BufferedReader(fr); String data = br.readLine(); while(data !=null){ data = br.readLine(); } br.close(); return data; } catch(FileNotFoundException e){ String bad = "Sorry there wasent a file"; ...

28. file reading problem    coderanch.com

Hi All, I have a file which contains data with formats including (BIN,BCD,TBCD). can anyone please tell me how can I parse this file? I want file to be parsed in the text format with string representation means if we parse the file it should be in "this is test file" etc.... will be the output format... Thanks!!!

29. read a Double from a File    coderanch.com

Hai, I have some file xx.txt, it has the double values stored in it like below 1.2 1.4 23.44 12.78 23.4 12.45 23.0 10.4 i wanted to read this file and print to the Screen I tried with my knowledge up to the following level. could any one help me to find the way. thanks import java.io.DataInputStream; import java.io.FileInputStream; import java.io.FileNotFoundException; ...

30. How to specify the place from file which is going tobe read    coderanch.com

How can I do that? When I use an Eclipse, its simple. The root directory of project is the place where I store my files. But what, let say, in servlets? When I read from servlets a file, it have been read from "user.dir" property (example: C:/Documents and Settings/Slobodan/". How can I specify that a file should be read from the ...

31. Reading files from the end    coderanch.com

Hello, Hello, I have to read 2 fields which are located at the end of a text file. Is there any way to do that without reading the complete file? Is it possible to start reading a file from the end and finish on top? Many thanks. <.....> <.....>

32. reading files    coderanch.com

hey all. i have a file named "file.txt" and it has the following contents; John 18yrs M ID123 Sarah 17yrs F ID132 Peter 19yrs M ID221 Mike 19yrs M ID114 Eve 20yrs F ID134 i want to read all this lines, here is my code.. it only reads the first line and it doesn't stop. import java.io.*; import java.util.*; public class ...

33. reading files    coderanch.com

hey people, i am new to java and need some help.. i have a file which stores car details; owner, make, model, color, regnumber Paul Audi A4 black MW5463 Betty RangeRover sport white MW4322 Mike Toyota hilux2.7 blue MW3421 Saun Nissan March white MW1234 the program shud accept input from keyboard and if it match any details, it outputs the line ...

34. Reading files from Connector    coderanch.com

35. how to read pst files using Java    coderanch.com

Thank you Ulf for the information. But I have used xena, it can not deal with .pst files and apache poi library can parse only .msg files. I don't know how to parse these .pst files on my hard disk using a java api. Any information on any commercial or open source java library which can parse .pst files is much ...

36. Reading from CD    coderanch.com

37. Read a music file    coderanch.com

38. reading a file column wise    coderanch.com

39. problem in reading a file.    coderanch.com

I want to read the frequency of each character through my java program.It has compiled successfully but when i am running it,it is showing me null pointer exception.what is the problem with it. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Properties; public class FileInput { char ch;int count; public static void main(String[] args) { FileInput sts = new FileInput(); ...

40. Reading from a file    coderanch.com

and then surround them by {} Something like that would work. Not very well, but it would work. The problem with using array-of-arrays is that you only know the size of the '-of-arrays', I imagine? You would have to read the whole file first to 'know' how many address entries there were? What you want to do is build up a ...

41. How to read a file on the internet?    coderanch.com

A year ago, for one of the tools that I wrote, I used the URL class, instead of the apache HttpClient class. The reasoning was, it was a small tool, and I didn't want to rely on any external jar files. That tools have grown since then. It now uses both http and https. Does stuff like password challenges. URL forwarding. ...

42. Help Required to read a file content    coderanch.com

First, you need a BufferedReader to read each line of the file. Then, for each line, you can call the split method to get you string represented as an array of String without the '|' character. This code may help you doing this : File yourFile = new File("path/to/the/file"); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(new FileInputStream(yourFile))); ...

43. Weird characters when reading a file    coderanch.com

44. How to read file as a different user from java application    coderanch.com

Hi, I am running a java web application as unix user USER1. The application connects to a database whose DB username and password is stored in a file(say xyz) which is readable only for unix user USER2 and not USER1. How can I read the username and password from the file whic is accessible only to USER2 while running my application ...

45. XmlFile Reading    coderanch.com

Hi, I have some doubt regarding xml reading and maintain data. Supoose i have a XML file, which maintaing some stack orders. for every second, huge no of requests coming to my server. So for each and every request i dont want to hit my XML file. For that sake i load the data once in application scope or ... Suppose ...

46. Reading from a file    coderanch.com

I am having some problems reading from the input file, but not sure why. I have the file saved in the same folder and named the same (InFile)... and ideas? package iowithscanner; import java.util.Scanner; public class Main { public static void main(String[] args) { InFile input = new InFile ("C:\\Documents and Settings\\Audrey\\Desktop\\IOWithScanner\\src\\iowithscanner\\InFile.txt"); int [] temp; temp= new int[100]; int x=0; int ...

47. Reading from a file ?    coderanch.com

Hello Every one ;) I was wondering about a way to solve this code - or in other words make it work !! Basically the idea behind it : read a file and process comands based on that file. The main issue with this code is I can't really figure out why the first if statement is not executed ? System.out.println ...

48. How to read a Gedcom file in java    coderanch.com

Piyush Patel wrote:i didnt get how to make GEDCOM files. and which library is there? please do some help ... Piyush, everyone here is willing to help. But for questions like these, it's far easier to use a search engine and find out any documentation. I have zero knowledge (atleast until a few seconds back) about GEDCOM and have ...

49. Read file until EOF from offset each time    coderanch.com

Aight. This is my question : // Keep reading the file in a loop for some 100 seconds.. for (int x=0; x<100; x++) { // Code for reading file - say readFile() Thread.currentThread().sleep(1000); /* sleep for one second */ } Now, I need to read a file (whose contents may keep changing over the course of the 100 seconds). Everytime I ...

50. can not read file    coderanch.com

Hi all, Im trying to read a file from a fileserver by setting up an ftp connection, where the path is passed as argument to the method. I have this following line to read the file from the given path, but it is throwing a null pointer exception. in = new BufferedReader(new InputStreamReader(ftp.getInputStream(filepath, 0))); where filepath is Fileserver\system\test\finals.txt There is no ...

51. Please explain the working of read() function    coderanch.com

It is written on the websites that read() function (without any arguments)of FileReader class reads a file character by character. But when I executed the following loop it returned the correct size of the file in bytes whereas according to definition of read() function it should return the half of the size of file in bytes. Why is it so? while((c=fr.read())!=-1) ...

52. Need help Read the File and replace its Header contents    coderanch.com

Thanks Rob for the response , I dont want to read the data into Memory The Problem is when i am using RandomAccessFile and using seek(0) , and writing using writeChar('~') The File is being corrupted , means some charaacters are being reversed or an extra space is being added. Please help.

53. Reading Data from a file and extracting the data    coderanch.com

Hi All, I have a huge log file and I would like to know if I can use file I/O streams to read the entries log files and extract all the data only for a particular day into an other file. Note: The log file has a specific format in which the first line of the log specifies Date/Time.Also Not all ...

54. Reading a file    coderanch.com

55. Need help with using Greek letters read in from file    coderanch.com

Hi all, if any of y'all have suggestions, let me know cause i'm stuck here. I have a greek word "" (= "September" fyi), my goal is to use each character in the string to match it to the the first character in a line from the file (which will be stored in an array) example: i hit the "" in ...

56. Reading the file    coderanch.com

57. file reading problem    coderanch.com

Hi, I want to do some I/O operation using LineNumberReader class. In snippet is the portion of the file which i want to operate on. Here F02. is the function name and i have to count number of lines present in the function. F02-FN. this is the end of the function. Can I go back to 417300 F02. EXIT. P000 this ...

58. How to read property which is conssiting of two values    coderanch.com

Hi , I need to read a property File that is having two values : sample File : Country : NORWAY , DENMARK Please let me know how can i read two values from a single property . Thnaks in advance . How to read property which is conssiting of two values Here i am free to use csv files also ...

59. Need to read XMI file through java code    coderanch.com

Hi All, Is there any way i can read an XMI file by writing java code rather that using nay tool(like EMF, MDI etc)? I want to write a java program which can read all the classes and attributes in an xmi file and then load then in the memory. Please help.

60. how to read from file from a remote machine    coderanch.com

@Rob, I am not passing the domain. Although I saw some examples on the internet where the domain are being passed. I had solved this problem by mounting the drive. For anyone else wanting to know the solution, I mounted the drive by assigning it an unused drive. I used the process command - net use F:/servername/shared \user username password

62. File Reading    coderanch.com

How long does it take to just read the file line by line? And with just read I mean just that - just read. Don't do anything with the lines you read. Because 25 minutes for a 100MB file seems odd, and I doubt it's the reading part that is causing this slowness. The processing of the lines seems like a ...

63. Immediate read timeout    coderanch.com

As far as I can see the standard Java classes does not give the option of retrying a connection a number of times and setting timeout. Since I need that and at several place in my project I have defined a static method that looks like this. public static InputStream getInputStream(URL url, int count, int wait, int timeout) throws IOException, InterruptedException ...

64. Problem with renaming file after reading it    coderanch.com

I have a problem with renaming a file after reading it. first I open the file File f = new File(s); br = new BufferedReader( new InputStreamReader( new FileInputStream(f))); I read the file String line = readFile(br); The file is closed br.close(); Then I try to rename the file File a = new File(s); a.renameTo(new File(s+".done")); But the file is not ...

65. reading from a file    coderanch.com

66. progress bar while reading object    coderanch.com

Hi, Is there a simple way to show progress bar while reading a big object? Maybe my reader can be wrapped with another object which adds progress bar? I have also the second question. I am writing a big object to file. Is there a chance to give writing thread a higher priority? I am using 'writeObject' method from ObjectOutputStream.

67. Read from file.    coderanch.com

Hi, How do I read a text file until a particular character, and then stop reading? The format of the text is a multiple choice question. The file has 300+ questions. Sample format: XYZ02 (C) [Ref. 00.a(b)(4)] If some java programmers are vegetarians and some java programmer parties serve Pizza; are all programmers crazy? A. Yes B. No C. Only C++ ...

68. Read file    coderanch.com

71. Reading large files in Java    coderanch.com

Hello I want to calculate the MD5 hash of a file (1-2Mb size). Problem is that with my current approach, it required a lot of time to calculate the hash. Is there any way to do this faster? I am doing it like this: br = new BufferedReader(new InputStreamReader(new FileInputStream(file))); String fileContent = ""; String line; while ((line = br.readLine()) != ...

72. reading primitive types from files    coderanch.com

The way Java implemented I/O Streams allows you to mix their capabilities together, which can be a really powerful feature. In this case, you need a BufferedInputStream to improve performance. Something like: DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(myfile.dat),4096))); That's a stream that reads from the file "myfile.dat" into a 4096 byte buffer, and then parses your data out of the ...

74. read config file properties dynamically    coderanch.com

resource handler class which will get the config manager object package .utils; import .ConfigManager; import .ConfigManagerFactory; import Constants; import java.io.Serializable; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; import org.apache.log4j.Logger; public class ResourceHandler implements Serializable { private transient ResourceBundle rb; private Locale locale; private String languageCode; private String customerCode; private static final Logger LOG = Logger.getLogger(ResourceHandler.class.getName()); public ResourceHandler(String languageCode,String customerCode) { this.customerCode=customerCode; this.languageCode=languageCode; ...

75. Reading data from files    coderanch.com

Java has built-in I/O APIs that can do what you want to do. Basically, what you need to do is create an input stream that can read from a file, and invoke read() method on it. Then, you must open an output stream that can write to a file, and invoke write() method on it with proper parameters. If you have ...

76. how to read context from outside file.    coderanch.com

First off, web.xml is application-specific, not user-specific. So it really has no role in any of this. It sounds as if the SSO component -whichever that is- should be able to propagate the login and user information across all web apps. After all, if it can't do that, what is its use?

77. Reading in different variables    coderanch.com

Hi, I've setup an ObjectInputStream and its waiting to recieve a String or an object. Is their a way for it to distinguish between the two. I tried to setup two threads one looking for a string the other for my object but they seem not to work together as they are listening on the same port. Thanks

78. Objects not the same after reading from XML    coderanch.com

Ok so my problem is that I'm JUnit testing a method that uses an XML decoder, however the objects produced fail an assert equals test. The code is below. Thanks in advance. from Module class public static Module read(String filePath) throws IOException { Module result; XMLDecoder decoder = new XMLDecoder( new BufferedInputStream( new FileInputStream(filePath))); result = (Module)decoder.readObject(); return result; } from ...

79. Problem reading a file    coderanch.com

I am reading text file in java using following code BufferedReader bufferedReader = null; try { FileReader fileReader = new FileReader(filePath); //FileInputStream fis = new FileInputStream(new File(filePath)); bufferedReader = new BufferedReader(fileReader); String line = null ; while((line = bufferedReader.readLine())!= null){ System.out.println(line); } fileReader.close(); bufferedReader.close(); } catch (Exception e) { e.printStackTrace(); } When i execute the code i am getting output as ...

80. Sorting file by highest scores and reading it into textarea    coderanch.com

Hi, i'm coding this childrens game where to simplify i have a textfield where user enters name and then he/she gets to play this mini game where at the end you receive a score. This will bring up high scores screen where user is shown the scores on a textarea. I'm using wrting/reading methods to do so: public void writeFile() { ...

81. Help with reading text containing non-ascii character    coderanch.com

Hi guys, I need some help with reading text containing non-ascii characters from an excel file. For example, I want to be able to detect the "" symbol in the below text and convert it into the unicode escape sequence \u00A9 and store this to the database. The end consumer of this text is a Web browser, so this conversion is ...

82. Read files and replace Strings    coderanch.com

This is where I am at. I am only catering for 1 value to be replaced. import java.io.*; public class Replace { public static void main(String args[]) throws Exception { String str; String srcFile = args[0]; String resultFile = args[1]; String s1 = "HOSTNAME"; String s2 = "myDevelopmentServer"; try { FileInputStream fis = new FileInputStream(srcFile); DataInputStream input = new DataInputStream(fis); FileOutputStream ...

83. Reading a file    coderanch.com

File does exists on the desktop so i suppose all processes have permission.. and even i pasted the file in the project folder tried to access it is showing the same error . i m using windows 7 and the netbeans ide ... i turned off the firewall also.. and i have admin privilages also... what could have gone wrong

84. Tokenizing after reading from a file    coderanch.com

The first part of my assignment was to write a file (which I have done) with a matrix of information (First name, last name, gender, age, dependents and SIN/SSN). import java.io.*; //creates a comma delimited file using ASCII //I/O exceptions are not caught public class Directory { public static void main (String[] arg) throws IOException { File outputFile = new File("Directory.data"); ...

85. java read file problem    coderanch.com

Hi I have a program which in theory should work perfectly but is failing to produce the out come I expected. I am starting to believe that my firewall(standard windows), anti-virus(Microsoft security essentials) or even my OS(windows vista) is blocking it is blocking this program from working but I am never sure. Here is the code: package jwork; import java.io.*; public ...

86. Reading tif files on x64 system    coderanch.com

Hi ranchers! I'm currently working on a Java program (part of my master thesis) that automatically identifies and crops document pages in digital images. The digital images that the program is supposed to read, are stored (and will by default be generated) as tiff files. To avoid having a step of manually converting the files to another format (currently png), I ...

87. Reading Through System.in    coderanch.com

Does it really go into an infinite loop? You do realise you have to give it a null line, which you do by entering the end-of-file character? On Windows try ctrl-Z, on *nix try ctrl-D. If you don't give it an end-of-file, it always assumes it is at the start of a new line.

88. Reading from a File, Need help    coderanch.com

When i am executing the code below by the command javac ShowFile.java java ShowFile the output is Usage ShowFile File java ShowFile TEST.TXT output : FileNotFound i don't understand the logic of this program, shall i create a file before executing a program or what ?? if yes then where shall i place the file, in the bin folder where jdk ...

89. Read file from localhost?    coderanch.com

90. Reading A File    coderanch.com

Hi, i am working on a program that has to read a file, save the variables, and write it to a new file in a different format. However I am having trouble saving each variable the way id like to. The file I am reading is in this format. firstname lastname firstname lastname I need to store the first name and ...

91. XML Writting & Reading    coderanch.com

Hi there, I don't know if this feature is included in SAX, but it would be very useful if I could read/write a given class instances to and from *.xml files, by defining the tags through annotations, such as you do to define object persistence in a JPA framework. I am pretty sure this must be included in SAX but the ...

92. Reading File in Java    dbforums.com

93. Read Content from dat file into textboxes    go4expert.com

Hi i have to do a project and its due in like 2days and i cant figure out whats wrong with it!! I managed to get the project writing the info to the dat file, however it won't read it back. It's compiling fine, it's just for some reason the read method won't work and the next and back buttons won't ...

94. Reading a file    go4expert.com

I want to read a file of bits and convert those bits in boolean array. Following is the file to read from 3 indicates the no. of input strings. Then follows a blank line Each input string is separated by a blank line. ------------------------------------------ 3 110 111 111 110 000100110011111 100010110111011 011110011101101 011001111111001 011011001111110 101101110010011 100111110110110 001101101011110 111010000000000 010101111110100 111011100101101 111111001001110 ...

95. reading a file    java-forums.org

i tried that too, i am also getting the output as well as the exception with it. what i am trying to do is read a file that contains only one integer. but the file may end with '\n' or may not. so if there is a newline character after the integer, its throwing an exception. if its before, its not. ...

96. Read From File need help    java-forums.org

import java.io.*; import java.util.*; public class one { public static void main(String[]args) throws Exception { Scanner sc = new Scanner(new FileReader("Input.in")); int min = Integer.parseInt(sc.next()); int max = Integer.parseInt(sc.next()); int count=0; int maxCount=0; for(int x=min;x<=max;x++) { int temp=x; //System.out.print(x+" "); do{ if(temp%2==0) temp=temp/2; else temp=(temp*3)+1; count++; //System.out.print(temp+" "); } while(temp!=1); //System.out.print(count+1); if(temp==1) { if(count>maxCount) maxCount = count+1; count=0; } //System.out.println(); } ...

97. Reg: File Reading Problem    java-forums.org

Hi, Could plz help me . I am reading files from text file using Java coding. ------Log Entry Date and Time Error Description :Exceptions Null Pointer Exceptions ------Log Ended Date and Time My requriement is to display particularly Null pointer Exceptions and Log Entry Date and Time also .I have displayed Null Pointer Exceptions in the file ,Using below coding while(stringvalue=reading ...

98. Readin from a file. and storing the information. (read inside)    java-forums.org

public void encryptFile(String fileName) { try { String inputFile = fileName+".java"; File file = new File(inputFile); int fileLength = (int)file.length(); byte fileBytes[] = new byte[fileLength]; DataInputStream dos = new DataInputStream(new BufferedInputStream(new FileInputStream(inputFile))); dos.readFully(fileBytes, 0, fileLength); dos.close(); File Name = new File(inputFile); Name.delete(); for(int currentByte = 0; currentByte < fileBytes.length; currentByte++) fileBytes[currentByte] = (byte)(~fileBytes[currentByte]); FileOutputStream encryptedFile = new FileOutputStream(fileName+".txt"); encryptedFile.write(fileBytes); encryptedFile.close(); } ...

99. How to read content from a file    java-forums.org

hi, not sure if i'm in the right place. i need some guide here. how do i read the content from a file. The name of file will different when created therefore not sure if able to use bufferedreader as it require a static filename to read the content. thanks in advance.

100. Reading a file    java-forums.org

I'm having some trouble with this program, and any help would be great. I need a program to scan through a file, find a line that begins with a specific word, save that to a string, then keep scanning for another different keyword. If the second keyword is found before another line with the first the string should be printed, if ...