Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Correctly Saving Delimited Files.

Correctly Saving Delimited Files

Written by Allen Wyatt (last updated October 2, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003


Raymond indicated that he was having some problems properly exporting delimited files from within Excel. Raymond was requesting that Excel create a file using the tab character as a delimiter. It seems that Excel would not reliably add a tab character at the end of a row when the last field in the row was empty.

Actually, this is how Excel is designed to operate. When exporting information to a delimited file, each row in the data table is handled independently. If one particular row has fewer fields than other rows, Excel doesn't "pad out" the exported row with "blank" fields. This can, of course, lead to problems with some other programs that use the Excel-created file and rely on a static number of fields in each input row.

A workaround for this potential problem is to simply make sure that Excel always has something in every cell of the final column of your data table. This is actually easier than it sounds—all you need to do is make sure the right-most column contains some unique text string, perhaps something like [{|}]. (It is unlikely that such a string would be used elsewhere in your data.) When you export to a delimited file, Excel will always export the same number of fields per row, right up to the unique text string. Then, when you import the delimited file into your other program, you can instruct it to ignore the last field of each row that it imports.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2589) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Correctly Saving Delimited Files.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Understanding Views

Want to see how your document will look before it's printed? Or, do you want to see what things will look like if you put ...

Discover More

Cleaning Up Text in a Macro

Need to remove extraneous characters from a text string? VBA makes it easy through the CleanString method, described in ...

Discover More

Creating Point Pages

Want to add a page, with a different page number, in Word without affecting the entire document? The solution is a bit ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (menu)

Cannot Double-Click to Open a Workbook

When you double-click on a workbook in Windows, the Excel program should be started and the workbook loaded. When this ...

Discover More

Short-Lived Book1

If you have a problem that crops up when you first start Excel, it can be a bear to track down the cause of the problem. ...

Discover More

Determining If a File Exists

Before you have your macro open and read a file from disk, you'll want to check to make sure it is really there. Here's ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 - 5?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.