Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / July 2006

Tip: Looking for answers? Try searching our database.

copy elements from a file to another file

Thread view: 
Andrea - 19 Jul 2006 16:22 GMT
Hi,I hope someone will help me because I have a problem. I have 2
files.txt. I have to take one element contained in a row of the first
file and find it in the second file.
If in the second file I find the element I want copy the row in which
there is the element and the 9 previous rows. So, in the second file I
will be 10 rows; the last
rows contained my element.

void WriteData (String GPSCANfile,String SPHfile)
   {
       try
       {
           BufferedReader gpscanf = new BufferedReader (new FileReader
(GPSCANfile));
           BufferedReader sphf   = new BufferedReader (new FileReader
(SPHfile));
           BufferedWriter file = new BufferedWriter (new FileWriter
("Data.txt"));

      .........
}

Someone can help me,please????
Thanks everybody
Andrew Thompson - 19 Jul 2006 18:12 GMT
> Hi,I hope someone will help me because I have a problem.

Only you can help that multi-posting problem, by not doing it.

Andrew T.
Lee Weiner - 19 Jul 2006 22:58 GMT
>Hi,I hope someone will help me because I have a problem. I have 2
>files.txt. I have to take one element contained in a row of the first
[quoted text clipped - 3 lines]
>will be 10 rows; the last
>rows contained my element.

How many lines are in the second file?  Is it plausible to load all the rows
of the second file into an array?

Lee Weiner
lee AT leeweiner DOT org


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.