ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Exporting to txt file, how to insert a "Enter" between lines (https://www.excelbanter.com/excel-programming/334738-exporting-txt-file-how-insert-enter-between-lines.html)

fidller

Exporting to txt file, how to insert a "Enter" between lines
 

Hi
I need to export a spreadsheet to a text file, (tab delimited) fo
importing into our accounting program (MYOB).
The accounting program needs an "Enter" between lines to recognize nex
customer.
How do I do this from within Excel

I can do it by having a empty cell between each entry, just does no
seem very elegant

Cheers
Ki

--
fidllerPosted from http://www.pcreview.co.uk/ newsgroup acces


K Dales[_2_]

Exporting to txt file, how to insert a "Enter" between lines
 
Perhaps I misunderstand: When you save a workbook as .txt, tab delimited,
there is normally an Enter (CR + LF) between each row from the worksheet, so
as long as your worksheet data range is arranged in rows the standard "Save
As" should work, I would think; is there something peculiar about how your
data is arranged on the sheet, or is there something different that you need
in the output .txt file?
--
- K Dales


"fidller" wrote:


Hi
I need to export a spreadsheet to a text file, (tab delimited) for
importing into our accounting program (MYOB).
The accounting program needs an "Enter" between lines to recognize next
customer.
How do I do this from within Excel

I can do it by having a empty cell between each entry, just does not
seem very elegant

Cheers
Kim


--
fidllerPosted from http://www.pcreview.co.uk/ newsgroup access



Gareth[_6_]

Exporting to txt file, how to insert a "Enter" between lines
 
Hi Kim,

Do you mean you need to have a blank line between each line in the text
file? Using the SaveAs tab delimited won't normally give you that unless
(as you have already pointed out) you have a blank *row* between each one.

As one solution you could force the "Enter" (actually a carriage return
and a line feed) by inserting it in the last cell of a row by having
=CHAR(13) & CHAR(10) in the last cell at the end of the row.

e.g.
What HowMany HowMuch FakeEnter
Monkeys 20 500 =CHAR(13) & CHAR(10)
Giraffes 5 1000 =CHAR(13) & CHAR(10)

Unfortunately, because these are "special" characters, when you save as
text it will insert quotes before and after them (try it and see). The
only way to get around this is to save as Space Delimited (*.prn) - you
can change the prn extension to txt when you save by typing your
filename in quotes e.g. "mynewfile.txt". If MYOB can accept this, then
this should be a good workaround for you.

Alternatively, you could do this more cleanly using VBA - this is the
programming NG after all. If you are familiar with VBA and want to try
that please post back. (Or check out the Open #, Print #, Close #
functions in VBA help.

HTH,
Gareth



fidller wrote:
Hi
I need to export a spreadsheet to a text file, (tab delimited) for
importing into our accounting program (MYOB).
The accounting program needs an "Enter" between lines to recognize next
customer.
How do I do this from within Excel

I can do it by having a empty cell between each entry, just does not
seem very elegant

Cheers
Kim




All times are GMT +1. The time now is 10:39 AM.

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