• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java File Copy

 
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have one report file ex.rpt and am copying this file and saving it as new file called ex.txt. And then am sending it to printer and the alignment is bad.

Again I opened a new notepad and then copy the contents of the text file and paste it in the notepad manually and saving it as ex.txt then sending it to printer.

Its printing fine.

How can I copy the contents of the file to a new notepad file(.txt file)
 
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
your problem statement is abstract, maybe you could post your code snippet in here

I am guessing that your problem is due to non printable characters such as carriage return,form feed, tabs that you may get this issue

keep in mind that in windows newline consists of "\r\n" and not "\n"

Do one test, open same (output) file in notepad and wordpad and see if there is any difference in view in both, if yes, then the problem is
definately due to newline characters.
There is a method by which you can find out the system's newline char but i leave that to you to figure out.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic