Importing Data from Delimited Text Files

Problem

You want to import data from a text file, but the data isn't in fixed-width format as in Recipe 3.1. This time, the data is delimited, i.e., separated by commas, spaces, tabs, or some other character.

Solution

Follow the import procedure described in Recipe 3.1, but select Delimited instead of "Fixed width" in step 1 of the Text Import Wizard (see Figure 3-2).

Discussion

When you select Delimited instead of "Fixed width," you don't specify column breaks during step 2 of the import procedure. Instead, you specify the delimiter that separates the data on each row being imported. In this case, step 2 of the Text Import Wizard looks like Figure 3-6 instead of Figure 3-3.

Figure 3-6. Text Import Wizard: Step 2 (Delimited file type)

The example data shown in the data preview window in Figure 3-6 was taken from one of my fluid dynamics simulations. It shows fluid field variables (velocity, pressure, density) as functions of position on a 2D grid. The output file consists of rows of data, with each number separated by a comma. I checked the comma delimiter in the import wizard dialog and the wizard automatically set the column break points. Pressing Next at this point takes you to step 3, as already discussed in Recipe 3.1.

See Also

See Recipe 3.1, Recipe 3.3, and Recipe 3.4 for alternative data importing techniques.

Using Excel

Getting Acquainted with Visual Basic for Applications

Collecting and Cleaning Up Data

Charting

Statistical Analysis

Time Series Analysis

Mathematical Functions

Curve Fitting and Regression

Solving Equations

Numerical Integration and Differentiation

Solving Ordinary Differential Equations

Solving Partial Differential Equations

Performing Optimization Analyses in Excel

Introduction to Financial Calculations

Index



Excel Scientific and Engineering Cookbook
Excel Scientific and Engineering Cookbook (Cookbooks (OReilly))
ISBN: 0596008791
EAN: 2147483647
Year: N/A
Pages: 206
Authors: David M Bourg

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net