RSS Forums RSS
Please support our Java advertiser: Lunarpages Java Web Hosting

10 line text file

Join Date: Jun 2004
Location: Aotearoa
Posts: 295
Reputation: szukalski is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 1
szukalski szukalski is offline Offline
Posting Whiz in Training

Re: 10 line text file

  #2  
Jun 21st, 2004
Parse the file as a string, then find char position of the second to last line return, substring from 0th char to 2nd last CR/LR (removing bottom line), and append this substring to the line you want at the top...?
oldFile >> originalString;
substring = originalString - last line;
newString = newText + substring;
newString >> newFile;
I think this will work, it's been over half a year since I last used java so I may be a bit rusty. (There are probably better ways of doing this also.. )
Overclocking is for geeks. I'm such a geek.
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:11 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC