Simple ... or maybe not - saving spreadsheet in text format

papaia

New Member
Joined
Feb 3, 2005
Messages
2
Hi, everyone,


I have this issue - which appeared very simple, in the beginning - that is bugging me now for quite some time:

Given: spreadsheet with "L" columns, with length of records varying inside each column from 6 to 24, ALMOST consistent by column (i.e. 90% of each column has the record length the same, and 10% differs in length).

Objective: saving this in a text file, with the beginning of each column perfectly aligned, no matter the length of the previous one

Tried:

1. PRN format - this is the only one preserving the beginning of the columns, thus aligning their beginnings. Problem? Limited in total length of lines to approx 240 characters (thus wrapping the output)

2. Various text formats (tab delimited, comma delimited, printing to a file via the generic/text printer, etc.)

3. Reformatted the columns in the spredsheet, to "force" the length of the records (where needed) to be the max sized ones (e.g. "Customs" - 000...00)

absolutely anything to no avail.

Any ideas, folks?

TIA,

Papi
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
You've heard of thinking outside the box - well this is "inside the box" thinking from me - I am not to proud to suggest this - as its the sort of thing I do - but there are probably "real" solutions to this which hopefully someone else will post:

On another sheet create formulas similar to:

=left(Sheet1!A1 & rept(" ",25),25)

Copy these down/right, adjusting as the 25 to whatever each column needs (you could even use a cell ref for this)

Then try exporting this sheet.
 
Upvote 0
Re: Simple ... or maybe not - saving spreadsheet in text for

I just now realized why PRN would work - it is about the "width" of the column, not the number of characters in it! I verified, and - once having data organized in a specific column WIDTH, without changing the number of characters in a record (i.e. no "customized" cells) - the export looks fine. The problem with prn exports is limited size, basically. I have also tried "printing" to a generic/text printer driver, to a file (which - I think - would keep the same properties I am interested in), but those are limited in output (paper size)

So - the whole question changes to: how can I preserve column width in txt exports?

thx,
Papi
 
Upvote 0

Forum statistics

Threads
1,203,354
Messages
6,054,919
Members
444,759
Latest member
TeckTeck

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top