Solved

Save Excel as tab delimited

Posted on 2014-12-03
5
282 Views
Last Modified: 2014-12-11
We have an excel spreadsheet that we save as a tab delimited (.txt) file for subsequent uploading to a web server for loading into a web database table.

I have done this for years; seems to function correctly using a Windows (7 or XP) PC.

A current customer uses a Mac. When they save an Excel sheet as tab delimited, there are no line breaks between the rows so the entire sheet is one massive blob. Of course, the web upload fails.

Is there an option one must use on the Mac to make it work like it does on a PC?

Note I DO NOT have a Mac, I am taking this from the customer, they emailed me the file & it was like I indicated.

Thanks
0
Comment
Question by:Richard Korts
5 Comments
 
LVL 53

Accepted Solution

by:
strung earned 500 total points
ID: 40479019
The problem is likely the difference between Mac and Windows line breaks.

Mac uses an ASCII "carriage return" at the end of each line.
Windows uses an ASCII "carriage return" plus an ASCII "line feed" at the end of each line.

When Excel on a Mac is saved as Tab Delimited it uses only carriage returns for the line breaks, no line feeds.

This can be solved at the Mac end if the user then opens the Tab Delimited file in the freeware TextWrangler ( http://www.barebones.com/products/textwrangler/download.html ), then does a "save as" choosing "Windows (CRLF)" in the save as dialogue box for the "Line Breaks" option. This saved file should then have the proper Windows line breaks.
0
 
LVL 53

Expert Comment

by:strung
ID: 40479034
Although I haven't tried it, I am told that if you set your FTP program to upload a text file as "ASCII" instead of "Binary",  it will change the line breaks automatically. You might give that a try.
0
 

Author Comment

by:Richard Korts
ID: 40479071
To strung,

Thanks.

The process uses php programs to do the upload, so there is no ftp involved (directly). The file is specified in a "file" input element on an html page.

I might be able to get the customer to do TextWrangler thing.
0
 
LVL 27

Expert Comment

by:serialband
ID: 40479721
You can also do it yourself on Windows with tofrodos.

http://www.thefreecountry.com/tofrodos/

Here's the sourceforge site link to the zip file  http://tofrodos.sourceforge.net/download/tfd1713.zip


You can also download the mac2dos, unix2dos, dos2mac, unix2mac programs to install on your Windows system to run them in your DOS Prompt or PowerShell:  http://sourceforge.net/projects/cs-cmdtools/files/
0
 
LVL 11

Expert Comment

by:tel2
ID: 40479888
Hi rkorts,

If changing the web server's PHP process is an option for you, then that might be the best long term, as it will save your (current and any future) Mac customers from having to do extra processing at their end, which is just a hassle for them.

So, I would suggest you change the PHP process so that after the file is uploaded, it automatically converts all the files into the same format before it continues with the process.  You could either:
a) Leave the Mac/Linux (LF line terminator) files as is, change all DOS/Windows (CR-LF line terminators) versions to LF only, then change your processing to accept LF line-terminators.
Or probably more simply:
b) Just change the Mac/Linux (LF line terminator) files to the DOS/Windows (CR-LF line terminators) style.

Another option is:
c) Just change the final processing so it accepts files with both types of line terminator.

tel2
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now