[Advanced-java] Processing text files
Wesley@lwsi.com
Wesley at lwsi.com
Tue Jun 3 21:56:24 2003
This is a multipart message in MIME format.
---------------------- multipart/alternative attachment
Got it. Thanks!
Thank you,
Wesley Choate
LWSI Support Programmer
David Rosenstrauch <david.rosenstrauch@aleri.com>
Sent by: advanced-java-bounces@lists.xcf.berkeley.edu
06/03/2003 03:43 PM
To
advanced-java@lists.xcf.berkeley.edu
cc
Subject
Re: [Advanced-java] Processing text files
Can't you do:
BufferedReader in = new BufferedReader(new FileReader(inputFile));
String line;
while((line=in.readLine()) != null) {
out.write(line);
}
DR
On Tuesday 03 June 2003 04:43 pm, Wesley@lwsi.com wrote:
> I was wondering if anyone knows an easy way to do this. I am needing to
> take a file that has end of line characters, carriage returns in it, and
> produce a text file that does not have these end of line characters.
> The white space I do need though. Here is some of the code I have been
> trying, but it does not do what I need
>
> public class fileCramming {
>
> /** Creates a new instance of fileCramming */
> public fileCramming() {
> }
>
> /**
> * @param args the command line arguments
> */
> public static void main(String[] args) throws IOException {
> File inputFile = new File("C:\\hex837F.txt");
> File outputFile = new File("C:\\hex837FJava.txt");
>
> FileReader in = new FileReader(inputFile);
> FileWriter out = new FileWriter(outputFile);
> int c;
>
> while((c=in.read()) != -1) {
> if(c != 10)
> out.write(c);
> }
> in.close();
> out.close();
> }
>
> }
>
>
> Thank you,
>
> Wesley Choate
> LWSI Support Programmer
_______________________________________________
Advanced-java mailing list
Advanced-java@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/advanced-java
---------------------- multipart/alternative attachment
An HTML attachment was scrubbed...
URL: /lists/advanced-java/attachments/20030603/77310179/attachment.htm
---------------------- multipart/alternative attachment--