Solved

Save Excel as tab delimited

Posted on 2014-12-03
5
298 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 28

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 12

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
powershell add exchange property to a report 12 51
.Range Set 25 77
Excel - Data Validation 3 27
VBA question, how many data set exists in the sheet 14 57
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.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

773 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