Prn file carriage return deletion within notepad

M

monster

Dear All

I am completely stuck :confused:

PROBLEM
I have a prn file which on creation always has a carraige return
inserted after the last row.

At the moment I am using VBA to generate the prn file but manually
opening notepad and deleting the carraige return and then saving it
again as a prn within notepad.

QUESTION
Is there a way, using VBA, to open the prn within notepad and delete
the carriage return? It seems to be hard coded. I have read the prn
in to notepad a line at a time but the carriage return remains.

Any help greatly appreciated.

Monster
 
D

Dave Peterson

On my wintel pc, I get a carriage return/linefeed at that end of every
line--including the last.

Are you saying that you got extra characters or that you don't want those
characters at the end of the file?

And just curious, why wouldn't you want those last crlf at the end of the last
line?
 
M

monster

My apologies, what I mean is this.

_In_a_9_line_prn_file._

line 1
line 2
line 3
..........
line 9<crlf>

It is this final <crlf> that I want to remove because the prn file i
used within a system (out of my control) that initially counts th
number of rows. With this carriage return, the number of rows i
increased by one (to 10). Effectively the system sees a 'final blan
record' (created from the carraige return).

Have I explained it any better?
Any ideas
 
D

Dave Peterson

You explained it ok the first time, too. I was just curious.

Try Charlie's code. I bet it works for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top