A quick way to parse spooled text files in Excel

If you want to parse spooled file rows, such as "First Second 123.456,77 First 11.22,33- Second" into separate columns, you don't need to use fancy formulas. Excel has a tool that makes the job a snap. It is needed only to use the Excel's Text To Columns feature.

Here's how it works:

First, select the column of cells that contains the raw data, and then open the Data menu and choose Text To Columns. When you do, Excel launches the Convert Text To Columns Wizard.

Choose the type that best describes the data and click Next, if you choose Delimited radio button, activate the check box for Space (deselect Tab, which is the default selection), since the delimiter in most cases is simply the space between the number and the label. If you choose "Fixed width", you have the opportunity to move, create or delete break columns.

You can click the Next button if you want to read the next Wizard screen. When you do, Excel will convert the tokens into separate columns and the numbers will be stored as values. You can also click the "Advanced button" to define the decimal and thousand separators and to define that the trailing minus is for negative numbers.


The Best Web Links: tips, tutorials and more.

Visit the ITKnowledge Exchange and get answers to your developing questions fast.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

This was first published in June 2005

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.