Results 1 to 2 of 2
Thread: Need help! Encoding from a file.
- 07-20-2011, 08:36 PM #1
Member
- Join Date
- Jul 2011
- Posts
- 1
- Rep Power
- 0
Need help! Encoding from a file.
Been working on this for a while now..

The idea is to "encode" a text file, then pass it on to the console and also a new file. Such as taking input from a text file that reads "Hello" and convert it for output reading "ifmmp". Each character value gets 1 added to it. Also each line of input should transfer to a "coded" line of output, then go to the next line.
The closest I can get to it is either just displaying the first line or if I change it to 'println' it displays everything, but as single characters per line.
Any help would be much appreciated!
Java Code:char sNew; String sOld = fin.readLine(); while ((sOld = fin.readLine()) != null) { for (int i = 0; i < sOld.length(); i++) { if (i < sOld.length()) { sNew = (char)(sOld.charAt(i) + 1); System.out.print(sNew); fout.print(sNew); } } //for } //while
- 07-20-2011, 08:41 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,414
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Change XML file encoding
By karq in forum XMLReplies: 0Last Post: 06-16-2011, 10:29 AM -
Encoding Problems in JRE
By xlomo in forum New To JavaReplies: 3Last Post: 02-28-2011, 09:13 AM -
Encoding of file output different from within netbeans to executing .jar
By goodvikings in forum NetBeansReplies: 0Last Post: 07-20-2010, 12:56 PM -
Some help with encoding...
By nm123 in forum NetworkingReplies: 0Last Post: 04-15-2008, 12:22 AM -
How to convert the encoding of a file
By valery in forum New To JavaReplies: 1Last Post: 08-06-2007, 03:48 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks