ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Single Space in PRN (https://www.excelbanter.com/excel-programming/344868-single-space-prn.html)

Pal

Single Space in PRN
 
Hi,

I've written a macro (Excel 2003) to reformat an input file. It's all
going well but the output must be in a space delimited format with only
a SINGLE space between the 2 columns. The problem is that Excel insists
on putting in 5 spaces.


Is there a way to trim the extra spaces down to 1?

Cheers,


Dave Peterson

Single Space in PRN
 
If your macro saves the file as .prn (space delimited), then you'll have to do
more.

You can try looking at the way others do it:

Earl Kiosterud's Text Write program:
www.smokeylake.com/excel
(or directly: http://www.smokeylake.com/excel/text_write_program.htm)

Chip Pearson's:
http://www.cpearson.com/excel/imptext.htm

J.E. McGimpsey's:
http://www.mcgimpsey.com/excel/textfiles.html



Pal wrote:

Hi,

I've written a macro (Excel 2003) to reformat an input file. It's all
going well but the output must be in a space delimited format with only
a SINGLE space between the 2 columns. The problem is that Excel insists
on putting in 5 spaces.

Is there a way to trim the extra spaces down to 1?

Cheers,


--

Dave Peterson

Pal

Single Space in PRN
 
Thanks for the excellent resources, Dave. I see that I'll have to write
the file line-by-line. Not a problem, thanks again for the trick.

Dave Peterson wrote:
If your macro saves the file as .prn (space delimited), then you'll have to do
more.

You can try looking at the way others do it:

Earl Kiosterud's Text Write program:
www.smokeylake.com/excel
(or directly: http://www.smokeylake.com/excel/text_write_program.htm)

Chip Pearson's:
http://www.cpearson.com/excel/imptext.htm

J.E. McGimpsey's:
http://www.mcgimpsey.com/excel/textfiles.html



Pal wrote:

Hi,

I've written a macro (Excel 2003) to reformat an input file. It's all
going well but the output must be in a space delimited format with only
a SINGLE space between the 2 columns. The problem is that Excel insists
on putting in 5 spaces.

Is there a way to trim the extra spaces down to 1?

Cheers,


--

Dave Peterson



Dave Peterson

Single Space in PRN
 
You may just want to try Earl's program. He has lots of options--including the
ability to specify the delimiter character (if I recall correctly).

(You may be done if you use Earl's program <bg.)

Pal wrote:

Thanks for the excellent resources, Dave. I see that I'll have to write
the file line-by-line. Not a problem, thanks again for the trick.

Dave Peterson wrote:
If your macro saves the file as .prn (space delimited), then you'll have to do
more.

You can try looking at the way others do it:

Earl Kiosterud's Text Write program:
www.smokeylake.com/excel
(or directly: http://www.smokeylake.com/excel/text_write_program.htm)

Chip Pearson's:
http://www.cpearson.com/excel/imptext.htm

J.E. McGimpsey's:
http://www.mcgimpsey.com/excel/textfiles.html



Pal wrote:

Hi,

I've written a macro (Excel 2003) to reformat an input file. It's all
going well but the output must be in a space delimited format with only
a SINGLE space between the 2 columns. The problem is that Excel insists
on putting in 5 spaces.

Is there a way to trim the extra spaces down to 1?

Cheers,


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 01:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com