473,417 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,417 software developers and data experts.

HOW detect EOF at below code

HOW detect EOF at below code? what put in place of
( i<3306 )
???

Expand|Select|Wrap|Line Numbers
  1.    public mergerTxt()
  2.    {
  3.       try 
  4.      {
  5. File file = new File( "us-skype.lang" ); // get file name
  6. File fileRu = new File( "ru-skype.lang" ); // get file name
  7. File file2 = new File( "skype6bufferedAll.lang" ); 
  8.         BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream (file), "UTF-8"));
  9.         BufferedReader readerRu = new BufferedReader(new InputStreamReader(new FileInputStream (fileRu), "UTF-8"));
  10.         BufferedWriter output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file2), "UTF-8")); 
  11.          String result; // result from checking file
  12.          String result2; // result from checking file
  13.          String result3; // result from checking file
  14.          int dot ;
  15.          int dot2;
  16.          int i=1;         
  17.          // file does exist
  18.          if ( file.exists() ) 
  19.          { 
  20.         while  ( i<3306 ) 
  21.             {   
  22.             i++;
  23.                result = reader.readLine(); // read a line from file
  24.                result2 = readerRu.readLine(); // read a line from file
  25.             dot = result.lastIndexOf("=");
  26.             dot2 = result2.lastIndexOf("=");
  27.             result3 = result.substring(dot + 1) + " = " + result2.substring(dot2 + 1);
  28.             output.write( result3 + "\n" ); // output line of file
  29.  
  30.  
  31.             } // end while
  32.          } // end if
Aug 14 '10 #1
2 1773
Dheeraj Joshi
1,123 Expert 1GB
Check if the returned character is null. If it is null that mean it is eof. Check API documentation for further information.

Regards
Dheeraj Joshi
Aug 14 '10 #2
I used below but the resulting file rather have 3306 lines (as the two merged files eng(1)=ru(2))has only 3201 lines, this is memory problem...how to fix?
Expand|Select|Wrap|Line Numbers
  1.             while  ( true ) 
  2.             {   
  3.             i++;
  4.                result = reader.readLine();                if (result==null) { break; }
  5.                result2 = readerRu.readLine(); 
  6. ......................
  7.  
Aug 14 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: RdU | last post by:
Hi, I've written a small VB.net 1.1 application. It uses the Webbrowser control (shdocvw.dll). The application loads and saves html pages to disk. The application checks if a document has been...
4
by: gokcemutlu | last post by:
I want to trace a function while it executes and keep its local variables as states. In trace function all the things work well but after all when I print states, they are all the same. I couldn't...
0
by: shrini | last post by:
hi all..... im not clear of the usage of the following typedef for the function pointer.. can any one help me out, briefing the syntax or usage importance?? code is below.. typedef void...
1
by: chockalingamn | last post by:
<html> <head> <script language="javascript"> var i=0,ta="T",qa="Q",ra="R",k=0.0,j=0.0; function addRowToTable() { var tbl = document.getElementById('ad'); var lastRow = tbl.rows.length -...
6
by: sanjay | last post by:
Hi, Is there any tool that would do static detection (doesnt execute the application) of dead code for C++ application. Few tools do show which code flow would never get executed, but i am...
2
Kosal
by: Kosal | last post by:
Dear All Can you help me to convert as below code to vb.net module Function GF_ListGroupsOfUser(ByVal stUserName As String) As String On Error GoTo err_ListGroupsOfUser Dim...
1
by: sureshl | last post by:
this code works well for the i.e but its not working in firefox . and also i want to do validations only if theatre is selected , but, this is validating for the museum also .code <html> <head>...
3
by: panki1qaz | last post by:
i generated the following code online for a rolling LED text.. but it is hyperlinked to the site from where i generated,, so how to remove it? code:: <embed FlashVars="bt=nullcon Goa 2010 7-8th...
4
by: BigAl42 | last post by:
My project involves a large number of ASP pages that reference an Access database. I am testing the system first via IIS before publishing it to the web server. The connection string is specific...
0
by: itsmenarwal | last post by:
HI Everyone.. I am not able to align links,videos,photos etc in right way.Foe example i have aligned sign out on right side page but when i click on any area which falls in the row area(in which...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.