A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Converting excel to text file - Issue with wrapping text



 
 
Thread Tools Display Modes
  #1  
Old August 26th, 2004, 04:32 PM
giridar
external usenet poster
 
Posts: n/a
Default Converting excel to text file - Issue with wrapping text

Hi,

I want to convert an excel file to a .prn file.

Here I need to retain the column width of all the columns in the excel
as it is. I could do that by changing the autoformat to None.

But the issue is when i try to save it as .prn file, it wraps up the
text in the .prn file. the maximum length it goes without wrapping in
the notepad is 236 character size.

I am not really sure how to convert it to a .prn file retain column
width without the wrapping in the text file.

any suggestions would be highly appreciated.

Thanks,
Giri


---
Message posted from http://www.ExcelForum.com/

  #2  
Old August 26th, 2004, 06:54 PM
dderolph
external usenet poster
 
Posts: n/a
Default

How do you convert an excel file to a .prn file? Do you mean you select
Print to file when you use the Print command? I did that but I can't
tell whether it's a .prn file; I don't see the .prn extension, even
from a DOS view.

Also, when I print to file from Excel, I can't open that file with
Notepad.

What about saving as a text file via Save As | Text? I just saved a
Excel sheet with a string of 398 characters in one cell. Then, I
opened it in Notepad. It displays as one line. Of course, Word Wrap,
under Format in Notepad, is disabled.


---
Message posted from http://www.ExcelForum.com/

  #3  
Old August 26th, 2004, 08:00 PM
giridar
external usenet poster
 
Posts: n/a
Default

actually if you open an excel file and then do a

"SAVE AS " and give the file type as "FORMATTED TEXT (SPACE DELIMITED"
, it would save it as a .PRN file.

secondly i am not trying to save a 309 character from a single cell.

wat i am trying to do is something like this.

col1 (50chars ) col2 say(50) col3 .................



then i want the same spacings to be maintained in the notepad too.

It starts giving this wrapping issue when the size of columsn together
exceed 236 in the excel.

In the notepad the wordwrap is disabled.

Hope this explains my problem.


---
Message posted from http://www.ExcelForum.com/

  #4  
Old August 26th, 2004, 08:58 PM
dderolph
external usenet poster
 
Posts: n/a
Default

I understand how a .prn file is created now. I tried to duplicate what
you're doing and I also find that Notepad limits the number of
characters it will allow to be displayed on one line.

However, as I mentioned in my previous post, saving the file as Text
(Tab delimited) does create a file for which Notepad will display
longer lines.

So, the only thing I can suggest is to try using a different file
format, something other than .prn.


---
Message posted from http://www.ExcelForum.com/

  #5  
Old August 26th, 2004, 09:27 PM
giridar
external usenet poster
 
Posts: n/a
Default

well

as you said the trying other than .prn would help get it in a single
line.

But it would defeat the original purpose i.e., to retain the column
lengths as defined in excel.

If i use tab delimited type, the original column spacing is not
reflected in the text file being created.

Since this is to be used for input of a program load, the spacing has
to be retained in the text file.

If you would know of any other format which if i use while saving the
excel with "SAVE AS " would allow the column width to be retained and
still store in single line without wrapping, please let me know.


---
Message posted from http://www.ExcelForum.com/

  #6  
Old August 26th, 2004, 10:07 PM
David DeRolph
external usenet poster
 
Posts: n/a
Default

Are you sure the program to which you want to load this data cannot be
configured to recognize some other format such as .csv?

If not, I think you might neet to use a different text editor. For example,
here's one from a Google search on text editors. See
http://www.textpad.com/. The specifications page says, "
a.. The 32-bit edition can handle file sizes up to the limits of virtual
memory. The 16-bit edition is limited to files of up to 32,500 lines, with a
maximum line length of 4096 bytes."

Also, you could probably find a freeware text editor that might serve your
purpose.

"giridar " wrote in message
...
well

as you said the trying other than .prn would help get it in a single
line.

But it would defeat the original purpose i.e., to retain the column
lengths as defined in excel.

If i use tab delimited type, the original column spacing is not
reflected in the text file being created.

Since this is to be used for input of a program load, the spacing has
to be retained in the text file.

If you would know of any other format which if i use while saving the
excel with "SAVE AS " would allow the column width to be retained and
still store in single line without wrapping, please let me know.


---
Message posted from http://www.ExcelForum.com/



  #7  
Old August 27th, 2004, 12:03 AM
Dave Peterson
external usenet poster
 
Posts: n/a
Default

There are limitations with saving as a .prn file (especially 240 characters per
line). If you try it and it doesn't quite work:

You have a few choices (try against a copy of your worksheet):

I'd either concatenate the cell values into another column:

=LEFT(A1&REPT(" ",5),5) & LEFT(B1&REPT(" ",4),4) & TEXT(C1,"000,000.00")

(You'll have to modify it to match what you want.)

Then I'd copy and paste to notepad and save from there. Once I figured out that
ugly formula, I kept it and just unhide that column when I wanted to export the
data.

If that doesn't work for you, maybe you could do it with a macro.

Here's a link that provides a macro:
http://google.com/groups?threadm=015...0a% 40phx.gbl

=======
And in win98's version of notepad, I could get at least 1025 characters per line
before it wrapped (automatically).

But that was just a display problem. I saved the file, reopened in a nicer text
editor (UltraEdit) and saw my line at 2500 characters with no line wrapping.

"giridar " wrote:

Hi,

I want to convert an excel file to a .prn file.

Here I need to retain the column width of all the columns in the excel
as it is. I could do that by changing the autoformat to None.

But the issue is when i try to save it as .prn file, it wraps up the
text in the .prn file. the maximum length it goes without wrapping in
the notepad is 236 character size.

I am not really sure how to convert it to a .prn file retain column
width without the wrapping in the text file.

any suggestions would be highly appreciated.

Thanks,
Giri

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson

  #8  
Old August 27th, 2004, 06:34 PM
Greg Evensen
external usenet poster
 
Posts: n/a
Default

Hi,
You need to set your paper size in the printer setup
to be wider for the Generic/Text Only printer. This is
because Excel is drawing each character to the device
context of the printer, and when it detects it has reached
the right margin, it wraps the line. Using a larger
paper size and/or using landscape mode will increase
the number of characters that will fit on a line.

Some programs just have the effect of cutting the
line off at the right margin because they assume the
line will fit. You may also try using a smaller font
size so that each character escapes less when the app
is drawing to the device context.

A device context is an in-memory drawing surface,
like a sheet of paper with a coordinate system based on
the resolution of the device, that a program uses to
draw to either a bitmap, screen, or printer.

Automate "print to file" with Virtual Port Monitor
http://www.alphatronics.com/AVPMon.html

Greg


giridar wrote in message ...
Hi,

I want to convert an excel file to a .prn file.

Here I need to retain the column width of all the columns in the excel
as it is. I could do that by changing the autoformat to None.

But the issue is when i try to save it as .prn file, it wraps up the
text in the .prn file. the maximum length it goes without wrapping in
the notepad is 236 character size.

I am not really sure how to convert it to a .prn file retain column
width without the wrapping in the text file.

any suggestions would be highly appreciated.

Thanks,
Giri


---
Message posted from http://www.ExcelForum.com/

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there an Excel File size limit? Paul Worksheet Functions 2 July 8th, 2004 08:41 AM
text wrapping issue... Ken Wells Publisher 2 May 5th, 2004 03:01 AM
Importing Text File to Excel Matthew MacCarthy Worksheet Functions 6 March 10th, 2004 12:06 AM
Extra quotation marks when converting to delimited text file Dave Worksheet Functions 3 December 5th, 2003 01:42 AM


All times are GMT +1. The time now is 12:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.