Class 14: Data Import and Export

Rashmi Mishra

 

Class 14: Data Import and Export

Objective:

To learn how to import data from various sources into Excel and export Excel data to different formats, which will help in managing and sharing data efficiently.


Topics Covered:

  1. Importing Data:
    • CSV Files: Learn what CSV files are and how to import them into Excel.
    • Text Files: Understand how to import data from plain text files.
    • Other Excel Files: Learn to import data from other Excel workbooks.
  2. Exporting Data:
    • PDF Format: Learn how to save your Excel data as a PDF.
    • CSV Format: Understand how to export your Excel data as a CSV file.

Detailed Explanation:

1. Importing Data

What is Data Import?

Data import refers to bringing data from external sources into Excel. This allows you to work with data stored outside of your current workbook, like in text files or other Excel files.

Types of Files You Can Import:

  • CSV (Comma-Separated Values) Files: These are simple text files that store tabular data in a structured way, where each line corresponds to a data record and fields within that record are separated by commas.
  • Text Files: These can be files that contain data separated by spaces or other delimiters (like tabs). They are not limited to commas.
  • Excel Files: You can also import data from other Excel workbooks, allowing you to consolidate data from multiple sources.

Steps to Import Data:

  1. Importing a CSV File:
    • Step 1: Open Microsoft Excel.
    • Step 2: Click on the Data tab in the ribbon at the top.
    • Step 3: Click on Get Data > From File > From Text/CSV.
    • Step 4: A window will open where you can browse your computer. Find and select your CSV file, then click Import.
    • Step 5: Excel will show you a preview of the data. Check to make sure everything looks correct.
    • Step 6: Click Load to import the data into a new worksheet.
  2. Importing a Text File:
    • Step 1: Open Microsoft Excel.
    • Step 2: Click on the Data tab.
    • Step 3: Select Get Data > From File > From Text/CSV.
    • Step 4: Choose your text file (.txt) and click Import.
    • Step 5: The Text Import Wizard will open. You need to choose whether your data is Delimited (separated by commas, tabs, etc.) or Fixed Width (fields are aligned in columns with spaces).
    • Step 6: Click Next, choose the delimiter if it's delimited, and click Finish.
    • Step 7: Click OK to load the data into your worksheet.
  3. Importing from Another Excel File:
    • Step 1: Open the Excel workbook where you want to import data.
    • Step 2: Go to the Data tab.
    • Step 3: Click Get Data > From File > From Workbook.
    • Step 4: Browse to the Excel file you want to import from and select it, then click Import.
    • Step 5: You will see a list of sheets in the selected workbook. Choose the one you need and click Load.

2. Exporting Data

What is Data Export?

Data export is the process of saving or sending your Excel data to a different format. This is useful for sharing your work with others or for using your data in other applications.

Formats for Exporting:

  • PDF (Portable Document Format): A file format that preserves your document's formatting and layout. It’s widely used for sharing documents.
  • CSV (Comma-Separated Values): A simple format for storing tabular data. It’s often used for importing and exporting data between applications.

Steps to Export Data:

  1. Exporting to PDF:
    • Step 1: Open the workbook that you want to export.
    • Step 2: Click on the File tab in the top left corner.
    • Step 3: Click on Save As.
    • Step 4: Choose where you want to save the file (e.g., This PC, OneDrive).
    • Step 5: In the "Save as type" dropdown menu, select PDF.
    • Step 6: You can choose to export the entire workbook or just the active sheet by selecting the appropriate option.
    • Step 7: Click Save. Your Excel data will be saved as a PDF file.
  2. Exporting to CSV:
    • Step 1: Open the workbook you want to export.
    • Step 2: Click on the File tab.
    • Step 3: Click on Save As.
    • Step 4: Choose the location where you want to save the file.
    • Step 5: In the "Save as type" dropdown menu, select CSV (Comma delimited) (*.csv).
    • Step 6: Click Save. Note that only the active worksheet will be exported.

Exercise:

  1. Import a Dataset from a CSV File into Excel:
    • Follow the steps above to import a CSV file.
    • Make sure to verify the data is imported correctly by checking for any missing or misaligned data.
  2. Export a Workbook to PDF Format:
    • Follow the steps above to export your workbook as a PDF.
    • Open the PDF file to ensure it has saved correctly and appears as intended.

Summary:

In this class, you learned how to import data from various sources into Excel, including CSV files, text files, and other Excel workbooks. You also learned how to export your Excel data into PDF and CSV formats. Understanding how to import and export data is essential for efficiently managing and sharing information in Excel. This knowledge will help you work with data from different sources and make your Excel files more versatile.