0% found this document useful (0 votes)
44 views

4 - Loading Text Files - Method 2

This document discusses a second method for loading text file datasets into Excel spreadsheets. The method involves changing the file extension of the text file from .txt to .csv, which allows Excel to open it like a CSV file without using a wizard. CSV files have become a standard data format that Excel can easily open. However, changing the file extension should only be done if the dataset is actually comma-separated; it may not always be appropriate. Once opened as a CSV, the file can then be saved as an Excel file (.xlsx) for easier manipulation in Excel. Larger CSV files may see a reduction in file size when converted to XLSX format.

Uploaded by

accmuk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

4 - Loading Text Files - Method 2

This document discusses a second method for loading text file datasets into Excel spreadsheets. The method involves changing the file extension of the text file from .txt to .csv, which allows Excel to open it like a CSV file without using a wizard. CSV files have become a standard data format that Excel can easily open. However, changing the file extension should only be done if the dataset is actually comma-separated; it may not always be appropriate. Once opened as a CSV, the file can then be saved as an Excel file (.xlsx) for easier manipulation in Excel. Larger CSV files may see a reduction in file size when converted to XLSX format.

Uploaded by

accmuk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

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

4 of 7 · Loading Text Files: Method 2

Learn

Another way to load text file datasets

Method 2 for text files


The next method we'll look at feels like a "hack," but it's sometimes necessary,
especially if your dataset wasn't saved with the proper file extension in the first
place. For this second method, you would go into your file explorer on your local
machine and change the file extension from .txt to .csv .

To do this, you'd make a copy of the text file ending in "txt" so you still have the
original, then change the file extension of the new file to end in "csv," so now it
would look like sales_data_set_start.csv . Then, you'd go back to Excel, and
select Open to load the file as you did in Method 1.

This time, you don't need to change the file type to see the file. Excel recognizes
the CSV file just as it recognizes a regular Excel file ( .xlsx ), and it will open it in
Excel without using the Wizard. CSV files have become so ubiquitous in the world
of data that Excel finally made it straightforward to simply open them like any
other workbook. There is one point of caution for this method, and it's that
you need to be sure your dataset is comma-separated before you change the file
extension!

CSV files are wonderful for passing datasets between different applications
because they've become a standard among data file formats. However, it's often
advantageous to save your CSV file as an Excel file ( .xlsx ). This is especially
true if you plan to use Excel to manipulate the file going forward. If you're working
with smaller files, like the one you're using in this lesson, the file size
will increase after being converted to an Excel file because of the extra overhead
https://app.dataquest.io/c/127/m/652/importing-data-into-excel-spreadsheets/4/loading-text-files-method-2 1/3
10/2/23, 2:14 PM Importing Data Into Excel Spreadsheets — Loading Text Files: Method 2 | Dataquest

that goes along with XLSX files. But, if your CSV file is quite large (larger than
100 MB), then saving it as an Excel file will often reduce the size of the file. And
having it in XLSX format allows Excel to be more efficient with the file because it's
optimized to work with Excel's native file format.

Finally, there is one more thing you need to know. If you simply go to Data > Get
Data to import your data, you'll be using Excel's Power Query tool, which
modifies the data format and uses advanced features that are beyond the scope
of this course.

For the sake of convenience, we have created a copy of the


file sales_data_set_start.txt and renamed this copy
to sales_data_set_start.csv for the exercise below.

Instructions

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

Notice that while you're browsing for files in Excel, the application
displays information about each file, such as Type and Size .

2. Open the file sales_data_set_start.csv that we created for you.

3. Use File > Save As to save your CSV file as an XLSX


file: sales_data_set_start.xlsx .

Use the drop-down menu on the right side of your screen, next to
the Save icon, to select the file type Excel Workbook (*.xlsx).

If you get a warning message saying the file already exists, select Ok to
replace the existing file.

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

4. Answer the questions below.

Questions

1. True or False: it's always appropriate to change the file extension of a dataset in
order to load it.
Correct!

False

This is correct.

True

2. What can you say about the size of your data file after you converted it from a
CSV to an Excel file?
(select all that apply)
Correct!

It's larger than the original CSV file.

This is correct.

It's larger than 10 KB but smaller than 100 KB.

This is correct.

It's approximately 1 GB.

It's approximately 1 KB.

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

You might also like