0% found this document useful (0 votes)
35 views9 pages

3 - Loading Text Files - Method 1

The document discusses method 1 for loading text files into Excel spreadsheets. It describes opening a sample sales data text file, navigating to the Text Import Wizard, selecting comma delimiters since the file uses commas, and finishing the import. This loads the text file data into an Excel worksheet. The document notes there are multiple ways to import data into Excel and this method uses the Text Import Wizard after initially opening the text file.

Uploaded by

accmuk
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
35 views9 pages

3 - Loading Text Files - Method 1

The document discusses method 1 for loading text files into Excel spreadsheets. It describes opening a sample sales data text file, navigating to the Text Import Wizard, selecting comma delimiters since the file uses commas, and finishing the import. This loads the text file data into an Excel worksheet. The document notes there are multiple ways to import data into Excel and this method uses the Text Import Wizard after initially opening the text file.

Uploaded by

accmuk
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 9

10/2/23, 1:52 PM Importing Data Into Excel Spreadsheets — Loading Text Files: Method 1 | Dataquest

3 of 7 · Loading Text Files: Method 1

Learn

Text files: open or import?

Until now, we've used the word "load" to generically describe the process of
bringing your data into a spreadsheet. But to be more specific, you'll
use Open or Import when you're pulling your data into Excel. While earlier
versions of Excel were more rigid about using Open or Import, recent versions
offer greater flexibility for users to load data. In most cases, you can use
either Open or Import to load your data, but there are some exceptions. Let's
look at a scenario to illustrate this!

Your scenario

Suppose that you work as a data analyst for a national retail store. You're part of
a team of other analysts, and you've been asked to help prepare data for
analysis. Your first step is to load the data into Excel.

One of your colleagues has sent you the dataset


titled sales_data_set_start.txt . This dataset has several errors, and you'll use
it throughout the course as a way to learn how to clean and organize data.

If you were to open it in a text editor like Notepad, you'd see something like this:

https://app.dataquest.io/c/127/m/652/importing-data-into-excel-spreadsheets/3/loading-text-files-method-1 1/9
10/2/23, 1:52 PM Importing Data Into Excel Spreadsheets — Loading Text Files: Method 1 | Dataquest

Take a moment to inspect the dataset above. Looking closely, you'll see that it
contains commas that separate the data into columns. You'll also notice some
obvious errors, such as "Weakly Sales" — and some inconsistent values. Your
goal on this screen is to pull the text file data into Excel so that you can
manipulate it and prepare it for analysis. There are multiple ways to do this; let's
look at two of them.

Method 1 for text files

In Excel, if you were to select File, Open, Browse, you'd see a window similar to
this:

https://app.dataquest.io/c/127/m/652/importing-data-into-excel-spreadsheets/3/loading-text-files-method-1 2/9
10/2/23, 1:52 PM Importing Data Into Excel Spreadsheets — Loading Text Files: Method 1 | Dataquest

In the bottom-right (circled), you can choose the file type to open. For this
exercise, you can set it to All Files or change it to Text Files.

If you were to open the dataset, you'd see a window for the Text Import Wizard.
Notice that you started out choosing Open, but you were quickly moved over to
using Import. Excel has blurred the lines between Open and Import to make it a
seamless experience for the user.

https://app.dataquest.io/c/127/m/652/importing-data-into-excel-spreadsheets/3/loading-text-files-method-1 3/9
10/2/23, 1:52 PM Importing Data Into Excel Spreadsheets — Loading Text Files: Method 1 | Dataquest

The main thing you would need to focus on as shown above is to make sure
that Delimited and My data has headers are both selected.

If you were to click on Next, you'd see the following screen, which is where you
select the type of delimiter. It will probably default to Tab, which is incorrect. You
want Comma, so you would deselect Tab and select Comma as shown below.

You can see the difference in the Data preview window at the bottom. If you were
to toggle between the choices, you'd see how it affects the data in the preview
window!

https://app.dataquest.io/c/127/m/652/importing-data-into-excel-spreadsheets/3/loading-text-files-method-1 4/9
10/2/23, 1:52 PM Importing Data Into Excel Spreadsheets — Loading Text Files: Method 1 | Dataquest

Of course, if your data file used tabs, spaces, or semicolons as delimiters, you'd
want to select those.

After you click Next, you'd see the final screen of the Text Import Wizard:

https://app.dataquest.io/c/127/m/652/importing-data-into-excel-spreadsheets/3/loading-text-files-method-1 5/9
10/2/23, 1:52 PM Importing Data Into Excel Spreadsheets — Loading Text Files: Method 1 | Dataquest

Here you can set the Data Format for each column. For now, you'll use the
defaults. When you're done, click Finish, and you'll see your data loaded in
Excel:

https://app.dataquest.io/c/127/m/652/importing-data-into-excel-spreadsheets/3/loading-text-files-method-1 6/9
10/2/23, 1:52 PM Importing Data Into Excel Spreadsheets — Loading Text Files: Method 1 | Dataquest

You may notice some cells contain ####### instead of displaying data. This
happens when the column isn't wide enough to display the data. To resize a
column, hover your mouse cursor between two column headers
(e.g., B and C , just above the first row of data) until a double-headed arrow
appears, and then double-click. The column will automatically adjust its width to
display the data correctly.

Instructions

1. In Excel, select File, Open, Browse, and view the choices.

https://app.dataquest.io/c/127/m/652/importing-data-into-excel-spreadsheets/3/loading-text-files-method-1 7/9
10/2/23, 1:52 PM Importing Data Into Excel Spreadsheets — Loading Text Files: Method 1 | Dataquest

2. Locate the sales_data_set_start.txt dataset, and click Open.

To find the dataset: click This PC, and select the Home Folder.

Change the file type to All Files or Text Files to display the dataset.

3. On the first screen of the Text Import Wizard make sure


that Delimited and My data has headers are both selected. Click Next to
continue.

4. On the second screen of the Text Import Wizard, select the correct
delimiter.

Deselect Tab and select Comma. Click Next again to continue.

5. On the final screen of the Wizard, you can leave everything as-is and
select Finish.

6. Answer the questions below.

Questions
1. Using the data in your Excel worksheet, what is the value of Cell C382?
Correct!

415202.04

5/28/2010

461622.22

$461,622.22

This is correct.

2. True or False: there are multiple ways to load data into Excel.
Correct!

False
https://app.dataquest.io/c/127/m/652/importing-data-into-excel-spreadsheets/3/loading-text-files-method-1 8/9
10/2/23, 1:52 PM Importing Data Into Excel Spreadsheets — Loading Text Files: Method 1 | Dataquest

True

This is correct.

https://app.dataquest.io/c/127/m/652/importing-data-into-excel-spreadsheets/3/loading-text-files-method-1 9/9

You might also like