|
-
Writing to files and newlines
Hi
I'm trying to write a string to a text file for import into a database. I can grab the output text from the output window and paste it into a new document that then imports correctly, but when I write the string directly to a new text file the carriage returns turn into little boxes (can't post an example because pasting them here turns them into carriage returns)
I'm sure I'm not getting something - tried both UTF8 and ISO char encodings. Latest attempt below:
try {
Writer out = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream("C:/spudtwo.txt"), "UTF8"));
out.write(hand);
out.close();
} catch (UnsupportedEncodingException e) {
} catch (IOException e) {
Any help gratefully received.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks