Text import for excel

Excel for Microsoft 365 Excel 2021 Excel 2019 Excel 2016 Excel 2013 Excel 2010 Excel 2007 Excel Starter 2010 More…Less

Although you can’t export to Excel directly from a text file or Word document, you can use the Text Import Wizard in Excel to import data from a text file into a worksheet. The Text Import Wizard examines the text file that you are importing and helps you ensure that the data is imported in the way that you want.     

Go to the Data tab > Get External DataFrom Text. Then, in the Import Text File dialog box, double-click the text file that you want to import, and the Text Import Wizard dialog will open.

Step 1 of 3

Original data type    If items in the text file are separated by tabs, colons, semicolons, spaces, or other characters, select Delimited. If all of the items in each column are the same length, select Fixed width.

Start import at row    Type or select a row number to specify the first row of the data that you want to import.

File origin    Select the character set that is used in the text file. In most cases, you can leave this setting at its default. If you know that the text file was created by using a different character set than the character set that you are using on your computer, you should change this setting to match that character set. For example, if your computer is set to use character set 1251 (Cyrillic, Windows), but you know that the file was produced by using character set 1252 (Western European, Windows), you should set File Origin to 1252.

Preview of file    This box displays the text as it will appear when it is separated into columns on the worksheet.

Step 2 of 3 (Delimited data)

Delimiters    Select the character that separates values in your text file. If the character is not listed, select the Other check box, and then type the character in the box that contains the cursor. These options are not available if your data type is Fixed width.

Treat consecutive delimiters as one    Select this check box if your data contains a delimiter of more than one character between data fields or if your data contains multiple custom delimiters.

Text qualifier    Select the character that encloses values in your text file. When Excel encounters the text qualifier character, all of the text that follows that character and precedes the next occurrence of that character is imported as one value, even if the text contains a delimiter character. For example, if the delimiter is a comma (,) and the text qualifier is a quotation mark («), «Dallas, Texas» is imported into one cell as Dallas, Texas. If no character or the apostrophe (‘) is specified as the text qualifier, «Dallas, Texas» is imported into two adjacent cells as «Dallas and Texas».

If the delimiter character occurs between text qualifiers, Excel omits the qualifiers in the imported value. If no delimiter character occurs between text qualifiers, Excel includes the qualifier character in the imported value. Hence, «Dallas Texas» (using the quotation mark text qualifier) is imported into one cell as «Dallas Texas».

Data preview    Review the text in this box to verify that the text will be separated into columns on the worksheet as you want it.

Step 2 of 3 (Fixed width data)

Data preview    Set field widths in this section. Click the preview window to set a column break, which is represented by a vertical line. Double-click a column break to remove it, or drag a column break to move it.

Step 3 of 3

Click the Advanced button to do one or more of the following:

  • Specify the type of decimal and thousands separators that are used in the text file. When the data is imported into Excel, the separators will match those that are specified for your location in Regional and Language Options or Regional Settings (Windows Control Panel).

  • Specify that one or more numeric values may contain a trailing minus sign.

Column data format    Click the data format of the column that is selected in the Data preview section. If you do not want to import the selected column, click Do not import column (skip).

After you select a data format option for the selected column, the column heading under Data preview displays the format. If you select Date, select a date format in the Date box.

Choose the data format that closely matches the preview data so that Excel can convert the imported data correctly. For example:

  • To convert a column of all currency number characters to the Excel Currency format, select General.

  • To convert a column of all number characters to the Excel Text format, select Text.

  • To convert a column of all date characters, each date in the order of year, month, and day, to the Excel Date format, select Date, and then select the date type of YMD in the Date box.

Excel will import the column as General if the conversion could yield unintended results. For example:

  • If the column contains a mix of formats, such as alphabetical and numeric characters, Excel converts the column to General.

  • If, in a column of dates, each date is in the order of year, month, and date, and you select Date along with a date type of MDY, Excel converts the column to General format. A column that contains date characters must closely match an Excel built-in date or custom date formats.

If Excel does not convert a column to the format that you want, you can convert the data after you import it.

  • Convert numbers stored as text to numbers

  • Convert dates stored as text to dates

  • TEXT function

  • VALUE function

When you have selected the options you want, click Finish to open the Import Data dialog and choose where to place your data.

Import Data

Set these options to control how the data import process runs, including what data connection properties to use and what file and range to populate with the imported data.

  • The options under Select how you want to view this data in your workbook are only available if you have a Data Model prepared and select the option to add this import to that model (see the third item in this list).

  • Specify a target workbook:

    • If you choose Existing Worksheet, click a cell in the sheet to place the first cell of imported data, or click and drag to select a range.

    • Choose New Worksheet to import into a new worksheet (starting at cell A1)

  • If you have a Data Model in place, click Add this data to the Data Model to include this import in the model. For more information, see Create a Data Model in Excel.

    Note that selecting this option unlocks the options under Select how you want to view this data in your workbook.

  • Click Properties to set any External Data Range properties you want. For more information, see Manage external data ranges and their properties.

  • Click OK when you’re ready to finish importing your data.

Notes: The Text Import Wizard is a legacy feature, which may need to be enabled. If you haven’t already done so, then: 

  1. Click File > Options > Data.

  2. Under Show legacy data import wizards, select From Text (Legacy).

Once enabled, go to the Data tab > Get & Transform Data > Get Data > Legacy Wizards > From Text (Legacy). Then, in the Import Text File dialog box, double-click the text file that you want to import, and the Text Import Wizard will open.

Step 1 of 3

Original data type    If items in the text file are separated by tabs, colons, semicolons, spaces, or other characters, select Delimited. If all of the items in each column are the same length, select Fixed width.

Start import at row    Type or select a row number to specify the first row of the data that you want to import.

File origin    Select the character set that is used in the text file. In most cases, you can leave this setting at its default. If you know that the text file was created by using a different character set than the character set that you are using on your computer, you should change this setting to match that character set. For example, if your computer is set to use character set 1251 (Cyrillic, Windows), but you know that the file was produced by using character set 1252 (Western European, Windows), you should set File Origin to 1252.

Preview of file    This box displays the text as it will appear when it is separated into columns on the worksheet.

Step 2 of 3 (Delimited data)

Delimiters    Select the character that separates values in your text file. If the character is not listed, select the Other check box, and then type the character in the box that contains the cursor. These options are not available if your data type is Fixed width.

Treat consecutive delimiters as one    Select this check box if your data contains a delimiter of more than one character between data fields or if your data contains multiple custom delimiters.

Text qualifier    Select the character that encloses values in your text file. When Excel encounters the text qualifier character, all of the text that follows that character and precedes the next occurrence of that character is imported as one value, even if the text contains a delimiter character. For example, if the delimiter is a comma (,) and the text qualifier is a quotation mark («), «Dallas, Texas» is imported into one cell as Dallas, Texas. If no character or the apostrophe (‘) is specified as the text qualifier, «Dallas, Texas» is imported into two adjacent cells as «Dallas and Texas».

If the delimiter character occurs between text qualifiers, Excel omits the qualifiers in the imported value. If no delimiter character occurs between text qualifiers, Excel includes the qualifier character in the imported value. Hence, «Dallas Texas» (using the quotation mark text qualifier) is imported into one cell as «Dallas Texas».

Data preview    Review the text in this box to verify that the text will be separated into columns on the worksheet as you want it.

Step 2 of 3 (Fixed width data)

Data preview    Set field widths in this section. Click the preview window to set a column break, which is represented by a vertical line. Double-click a column break to remove it, or drag a column break to move it.

Step 3 of 3

Click the Advanced button to do one or more of the following:

  • Specify the type of decimal and thousands separators that are used in the text file. When the data is imported into Excel, the separators will match those that are specified for your location in Regional and Language Options or Regional Settings (Windows Control Panel).

  • Specify that one or more numeric values may contain a trailing minus sign.

Column data format    Click the data format of the column that is selected in the Data preview section. If you do not want to import the selected column, click Do not import column (skip).

After you select a data format option for the selected column, the column heading under Data preview displays the format. If you select Date, select a date format in the Date box.

Choose the data format that closely matches the preview data so that Excel can convert the imported data correctly. For example:

  • To convert a column of all currency number characters to the Excel Currency format, select General.

  • To convert a column of all number characters to the Excel Text format, select Text.

  • To convert a column of all date characters, each date in the order of year, month, and day, to the Excel Date format, select Date, and then select the date type of YMD in the Date box.

Excel will import the column as General if the conversion could yield unintended results. For example:

  • If the column contains a mix of formats, such as alphabetical and numeric characters, Excel converts the column to General.

  • If, in a column of dates, each date is in the order of year, month, and date, and you select Date along with a date type of MDY, Excel converts the column to General format. A column that contains date characters must closely match an Excel built-in date or custom date formats.

If Excel does not convert a column to the format that you want, you can convert the data after you import it.

  • Convert numbers stored as text to numbers

  • Convert dates stored as text to dates

  • TEXT function

  • VALUE function

When you have selected the options you want, click Finish to open the Import Data dialog and choose where to place your data.

Import Data

Set these options to control how the data import process runs, including what data connection properties to use and what file and range to populate with the imported data.

  • The options under Select how you want to view this data in your workbook are only available if you have a Data Model prepared and select the option to add this import to that model (see the third item in this list).

  • Specify a target workbook:

    • If you choose Existing Worksheet, click a cell in the sheet to place the first cell of imported data, or click and drag to select a range.

    • Choose New Worksheet to import into a new worksheet (starting at cell A1)

  • If you have a Data Model in place, click Add this data to the Data Model to include this import in the model. For more information, see Create a Data Model in Excel.

    Note that selecting this option unlocks the options under Select how you want to view this data in your workbook.

  • Click Properties to set any External Data Range properties you want. For more information, see Manage external data ranges and their properties.

  • Click OK when you’re ready to finish importing your data.

Note: If your data is in a Word document, you must first save it as a text file. Click File > Save As, and choose Plain Text (.txt) as the file type.

Need more help?

You can always ask an expert in the Excel Tech Community or get support in the Answers community.

See Also

Introduction to Microsoft Power Query for Excel

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Import or export text (.txt or .csv) files

There are two ways to import data from a text file with Excel: you can open it in Excel, or you can import it as an external data range. To export data from Excel to a text file, use the Save As command and change the file type from the drop-down menu.

There are two commonly used text file formats:

  • Delimited text files (.txt), in which the TAB character (ASCII character code 009) typically separates each field of text.

  • Comma separated values text files (.csv), in which the comma character (,) typically separates each field of text.

You can change the separator character that is used in both delimited and .csv text files. This may be necessary to make sure that the import or export operation works the way that you want it to.

Note: You can import or export up to 1,048,576 rows and 16,384 columns.

Import a text file by opening it in Excel

You can open a text file that you created in another program as an Excel workbook by using the Open command. Opening a text file in Excel does not change the format of the file — you can see this in the Excel title bar, where the name of the file retains the text file name extension (for example, .txt or .csv).

  1. Go to File > Open and browse to the location that contains the text file.

  2. Select Text Files in the file type dropdown list in the Open dialog box.

  3. Locate and double-click the text file that you want to open.

    • If the file is a text file (.txt), Excel starts the Import Text Wizard. When you are done with the steps, click Finish to complete the import operation. See Text Import Wizard for more information about delimiters and advanced options.

    • If the file is a .csv file, Excel automatically opens the text file and displays the data in a new workbook.

      Note: When Excel opens a .csv file, it uses the current default data format settings to interpret how to import each column of data. If you want more flexibility in converting columns to different data formats, you can use the Import Text Wizard. For example, the format of a data column in the .csv file may be MDY, but Excel’s default data format is YMD, or you want to convert a column of numbers that contains leading zeros to text so you can preserve the leading zeros. To force Excel to run the Import Text Wizard, you can change the file name extension from .csv to .txt before you open it, or you can import a text file by connecting to it (for more information, see the following section).

Import a text file by connecting to it (Power Query)

You can import data from a text file into an existing worksheet.

  1. On the Data tab, in the Get & Transform Data group, click From Text/CSV.

  2. In the Import Data dialog box, locate and double-click the text file that you want to import, and click Import.

  3. In the preview dialog box, you have several options:

    • Select Load if you want to load the data directly to a new worksheet.

    • Alternatively, select Load to if you want to load the data to a table, PivotTable/PivotChart, an existing/new Excel worksheet, or simply create a connection. You also have the choice of adding your data to the Data Model.

    • Select Transform Data if you want to load the data to Power Query, and edit it before bringing it to Excel.

If Excel doesn’t convert a particular column of data to the format that you want, then you can convert the data after you import it. For more information, see Convert numbers stored as text to numbers and Convert dates stored as text to dates.

Export data to a text file by saving it

You can convert an Excel worksheet to a text file by using the Save As command.

  1. Go to File > Save As.

  2. Click Browse.

  3. In the Save As dialog box, under Save as type box, choose the text file format for the worksheet; for example, click Text (Tab delimited) or CSV (Comma delimited).

    Note: The different formats support different feature sets. For more information about the feature sets that are supported by the different text file formats, see File formats that are supported in Excel.

  4. Browse to the location where you want to save the new text file, and then click Save.

  5. A dialog box appears, reminding you that only the current worksheet will be saved to the new file. If you are certain that the current worksheet is the one that you want to save as a text file, click OK. You can save other worksheets as separate text files by repeating this procedure for each worksheet.

    You may also see an alert below the ribbon that some features might be lost if you save the workbook in a CSV format.

For more information about saving files in other formats, see Save a workbook in another file format.

Import a text file by connecting to it

You can import data from a text file into an existing worksheet.

  1. Click the cell where you want to put the data from the text file.

  2. On the Data tab, in the Get External Data group, click From Text.

  3. In the Import Data dialog box, locate and double-click the text file that you want to import, and click Import.

    Follow the instructions in the Text Import Wizard. Click Help button image on any page of the Text Import Wizard for more information about using the wizard. When you are done with the steps in the wizard, click Finish to complete the import operation.

  4. In the Import Data dialog box, do the following:

    1. Under Where do you want to put the data?, do one of the following:

      • To return the data to the location that you selected, click Existing worksheet.

      • To return the data to the upper-left corner of a new worksheet, click New worksheet.

    2. Optionally, click Properties to set refresh, formatting, and layout options for the imported data.

    3. Click OK.

      Excel puts the external data range in the location that you specify.

If Excel does not convert a column of data to the format that you want, you can convert the data after you import it. For more information, see Convert numbers stored as text to numbers and Convert dates stored as text to dates.

Export data to a text file by saving it

You can convert an Excel worksheet to a text file by using the Save As command.

  1. Go to File > Save As.

  2. The Save As dialog box appears.

  3. In the Save as type box, choose the text file format for the worksheet.

    • For example, click Text (Tab delimited) or CSV (Comma delimited).

    • Note: The different formats support different feature sets. For more information about the feature sets that are supported by the different text file formats, see File formats that are supported in Excel.

  4. Browse to the location where you want to save the new text file, and then click Save.

  5. A dialog box appears, reminding you that only the current worksheet will be saved to the new file. If you are certain that the current worksheet is the one that you want to save as a text file, click OK. You can save other worksheets as separate text files by repeating this procedure for each worksheet.

  6. A second dialog box appears, reminding you that your worksheet may contain features that are not supported by text file formats. If you are interested only in saving the worksheet data into the new text file, click Yes. If you are unsure and would like to know more about which Excel features are not supported by text file formats, click Help for more information.

For more information about saving files in other formats, see Save a workbook in another file format.

The way you change the delimiter when importing is different depending on how you import the text.

  • If you use Get & Transform Data > From Text/CSV, after you choose the text file and click Import, choose a character to use from the list under Delimiter. You can see the effect of your new choice immediately in the data preview, so you can be sure you make the choice you want before you proceed.

  • If you use the Text Import Wizard to import a text file, you can change the delimiter that is used for the import operation in Step 2 of the Text Import Wizard. In this step, you can also change the way that consecutive delimiters, such as consecutive quotation marks, are handled.

    See Text Import Wizard for more information about delimiters and advanced options.

If you want to use a semi-colon as the default list separator when you Save As .csv, but need to limit the change to Excel, consider changing the default decimal separator to a comma — this forces Excel to use a semi-colon for the list separator. Obviously, this will also change the way decimal numbers are displayed, so also consider changing the Thousands separator to limit any confusion.

  1. Clear Excel Options > Advanced > Editing options > Use system separators.

  2. Set Decimal separator to , (a comma).

  3. Set Thousands separator to . (a period).

When you save a workbook as a .csv file, the default list separator (delimiter) is a comma. You can change this to another separator character using Windows Region settings. 

Caution: Changing the Windows setting will cause a global change on your computer, affecting all applications. To only change the delimiter for Excel, see Change the default list separator for saving files as text (.csv) in Excel.

  1. In Microsoft Windows 10, right-click the Start button, and then click Settings.

  2. Click Time & Language, and then click Region in the left panel.

  3. In the main panel, under Regional settings, click Additional date, time, and regional settings.

  4. Under Region, click Change date, time, or number formats.

  5. In the Region dialog, on the Format tab, click Additional settings.

  6. In the Customize Format dialog, on the Numbers tab, type a character to use as the new separator in the List separator box.

  7. Click OK twice.

  1. In Microsoft Windows, click the Start button, and then click Control Panel.

  2. Under Clock, Language, and Region, click Change date, time, or number formats.

  3. In the Region dialog, on the Format tab, click Additional settings.

  4. In the Customize Format dialog, on the Numbers tab, type a character to use as the new separator in the List separator box.

  5. Click OK twice.

Note:  After you change the list separator character for your computer, all programs use the new character as a list separator. You can change the character back to the default character by following the same procedure.

Need more help?

You can always ask an expert in the Excel Tech Community or get support in the Answers community.

See Also

Import data from external data sources (Power Query)

Need more help?

Skip to content

logo, professor, excel

Microsoft quietly replaced the comfortable Text Import Wizard from Excel and replaced it with the “Get & Transform” tools. The “Get & Transform” tools offer a lot of options and are very powerful. Unfortunately, they are quite complicated to use. Here is what you should now.

In a hurry? Click on “File” –> “Options” –> “Data” and set the corresponding checkmarks for reactivating the “Text Import Wizard” in Excel. Start the text import by clicking on “Data” –>”Get Data” –> “Legacy Wizards” –> “From Text (Legacy)”.

Introduction

In Excel 365 (only) 2016 (since version 1704) the “Text Import Wizard” was removed. It was replaced by the powerful “Get & Transform” tools. The “Get & Transform” tools also provide a function to import text and CSV files into Excel.

You have the following two options:

  1. Luckily, the comfortably “Text Import Wizard” still exists. You can re-activate and use it for importing text and csv files into Excel.
  2. Use the import function of the “Get & Transform” tools.

Restore the “Text Import Wizard”

re-activate, restore, activate, show, use, text, import, wizard
Re-Activate the Text Import Wizard in Excel.

The good news: You can easily restore the “Text Import Wizard”. Unfortunately, the option for re-activating them is hidden.

Follow these steps:

  1. Click on File and then on “Options”. Go to “Data” on the left-hand side.
  2. In the lower section of the window you can select the wizard you’d like to restore. For only importing text- or csv-files, select “From Text (Legacy)”. Feel free to also activate the corresponding wizard for importing Access files, files from web, from SQL servers and so on.
  3. Confirm with OK.
Use the “old” Text Import Wizard.

Now, you can find the so-called “Legacy Wizards” in the “Get Data” drop-down menu. In order to use them, follow these steps:

  1. Go to the “Data” ribbon.
  2. Click on “Get Data” on the left-hand side.
  3. Next, go to “Legacy Wizards”.
  4. Click on “From Text (Legacy)”.

How to use the “Text Import Wizard”

steps, text, import, wizard, excel

The steps for using the “Text Import Wizard” in Excel are shown in the screenshots.

  1. Go to the “Data” ribbon and click on “From Text”. If you have a recent Excel version and there is no button called “From Text” (but instead “From Text/CSV”), click on “Get Data”, then on “Legacy Wizards” and then on “From Text (Legacy)”. Please refer to the paragraph above if this option is missing.
  2. Select how you want to define the columns: Either with a character as a separator or with a fixed width.
  3. If the first row contains headers, check the corresponding box.
  4. Continue with “Next >”.
  5. Select the delimiter. This is the character dividing the data into columns, for example “Tab”, “Semicolon” or “Comma”.
  6. Usually text fields use quotation marks marking the beginning and end of a text field.
  7. For each column, you can choose the data format. For dates, you could define the order of days, months and years.
  8. Click on “Advanced”…
  9. …for defining decimals and thousands separators.
  10. Finalize the import by clicking on “Finish”.

Import text and csv files with the “Get & Transform” tools

Importing text files in Excel with the “Get & Transform” tools requires many steps. Please refer to the numbers on the screenshots:

  1. Click on “From Text/CSV” on the “Data” ribbon in order to start the import process.
  2. Choose the delimiter (e.g. semi-colon, comma etc.). Here you can also switch to “Fixed Width”. If you want to separate your import data with the “Fixed Width” option, you have to type the numbers of characters, after which you want to data to be divided.
  3. For further options (e.g. switching thousands- and decimal separators) click on “Edit”.
  4. If you data is not represented correctly, delete the automatically created step “Changed Type”.
  5. Change the date format: Right-click on a column that contains a date. Alternatively click on the small “ABC” symbol in the top left corner of the column heading.
  6. Move the mouse to “Change Type”.
  7. Click on “Using Locale…”.
  8. Select “Date”.
  9. Select the locale format for dates. In this example, the German date format is used.
  10. Confirm with OK. Repeat the steps 5 to 10 for each date column.
    Recommendation: Select several date columns at the same time by pressing and holding the Ctrl key while selecting the columns.
  11. Change the decimal and thousand separators: Right-click again on a column with decimal numbers.
  12. Move the mouse to “Change Type”.
  13. Click on “Using Local…”.
  14. Choose “Decimal Number”.
  15. Select the local number format. Please refer to this article for a list of local number formats.
  16. Confirm with “OK”.
  17. Last step: Insert the data into a worksheet. In order to achieve this, click on “Close & Load” in the top-left corner.

Henrik Schiffner is a freelance business consultant and software developer. He lives and works in Hamburg, Germany. Besides being an Excel enthusiast he loves photography and sports.

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.

.

Different applications generate data in different forms.

A SaaS application might generate a report in the form of a PDF, while another application might generate data in the form of a TXT or CSV file.

The challenge lies in consolidating the data into a single application that can work with all the data to produce the required results.

Microsoft Excel is one application that is frequently used for this, owing to its versatility in importing data from files with a wide variety of extensions.  

For example, if you have a list of items saved in a Text file (or in Notepad), Excel allows you to import this list so that you can process it further.

In this tutorial we will show you two ways to convert a text file to Excel:

  • By using the Text Import Wizard
  • By opening the file directly in Excel

What is a Text File?

A Text file is one that contains text with no special formatting (as in bold, italic, images, etc.).

These files are identified with the ‘.txt’ extension and can be opened in any text editor, like Notepad or word processor, like Microsoft Word.

But in many cases, you can have data in a text file that you need to open in Excel and analyze there.

Thankfully, you can easily open text files in Microsoft Excel and then further work on it.

Let’s see how to do that!

Let us look at two ways in which we can convert a Text file (.txt) to Excel.

Method 1: Using the Text Import Wizard to Convert a Text File to Excel

If you have a spreadsheet open in Excel and want to import the contents of a Text file at a specific area of your spreadsheet, the Text Import Wizard might be the best way to go.

This wizard scans your text file and ensures that the data in the file is imported the way you want.

To use the Text Import Wizard, select the Data tab, followed by ‘From Text’ (which you will find under the ‘Get External Data’ group. 

Click on the From Text option

After this, select the text file that you want to import.

Select the text file that you want to open

Your Text Import Wizard should now open automatically. 

Text Import Wizard

The Text Import Wizard guides you in providing the best settings to import your text file data through 3 steps:

Step 1 of 3

In this step you can provide the settings for the following:

  • Original Data Type: Here you can choose how you want your data to be separated into columns. You have two options:
    • Delimited: Select this if your text file data is separated by tabs, colons, semicolons or other characters.
    • Fixed width: Select this if all items in each column of your data are the same width.
  • Start import at row: Type or select the first row of your data from where you want to start importing.
  • File origin: Select the character set that your text file uses, for example 437 (for the OEM United States character set). Usually, it’s fine to leave this at the default setting.
  • My data has headers: Keep this field checked if your Text file’s dataset contains headers.
Step 1 settings for text import wizard

Step 2 of 3

If you had selected the ‘Delimited’ radio button in Step 1, then this step lets you specify the delimiters that your data contains (for example tabs, commas, semicolons, etc.) You can also specify if you want consecutive delimiters to be counted as one. 

Moreover, if your text values are enclosed in a special set of characters (for example in single or double quotes), then you can specify the character in this step.

These characters are known as ‘Text qualifiers’ and help specify if you want a set of values to be imported as one.

For example, “Scott, Steve” is imported as a single value, even though the words are separated by a comma delimiter.

Step 2 settings for text import wizard

At the bottom of the screen, you can see a preview of how your data will get affected in the spreadsheet after conversion.

If you had selected the ‘Fixed Width’ radio button in Step 1, on the other hand, then Step 2 lets you specify widths for each column.

You can introduce a new column break in the preview window by simply clicking at the appropriate point on the scale.

A line with an arrow should appear to represent the column break.

Line represents the line break

Place line breaks wherever you need to in the preview window.

If you want to move a line break, simply drag it across. If you want to remove a line, simply double-click on it.

Step 3 of 3

This lets you specify the data format for each column.

You can specify if you want a column to remain in the default format set by the Text Import Wizard or if you want to set the format to be General, Text, or Date

Step 3 settings for text import wizard

Simply select a column from the preview window and select the format you want.

If you want to remove a selected column, select the last radio button option (which says ‘Do not import column‘).

The Advanced button in this step opens the Advanced Text Import Settings dialog box. 

Advanced Text Import Settings dialog box

This dialog box lets you specify advanced formatting options.

For example, you can use the Advanced Text Import Settings to specify what decimal or thousands separators have been used in the text file, so that they can be made to match your computer’s regional settings.

Once you’re done providing all the settings for your imported text data, click on the Finish button.

Finish importing text file into Excel

This will open the Import Data dialog box.

Import Data dialog box

In this box, you can select where you want your text file’s data imported.

If you want to import it into the existing worksheet, you can select or type in a reference to the cell where you want Excel to start displaying the imported data.

If you want to open it in a new worksheet, however, then select the radio button next to ‘New Worksheet’.

Click OK.

Your text file should now get imported to your selected location in Excel, with the format settings that you had specified in the Text Import Wizard.

Imported data opened in Excel
Also read: How to Open XML Files in Excel?

Method 2: Opening a Text File Directly in Excel

You can also choose to simply open the text file directly in Excel.

While opening, Excel recognizes a text file and automatically converts it into a format that can be displayed in a spreadsheet. 

All you need to do is click on the File tab, select Open and then browse and select the text file that you want to open.

One issue that you are likely to face when trying to open a text file directly in Excel is trying to locate the file in the folder.

This is because Excel’s ‘Open File’ dialog box, by default, filters, and displays only Excel files like those with extensions ‘.xls’, ‘.xlsx’, etc.

It also displays CSV files, if your computer is set up to use Excel as the default application to open CSV files.

So if you don’t see your required text file in the folder when trying to open it in Excel, simply select ‘All Files’ from the ‘File Types’ drop-down, as shown below:

Select the file type from the drop down

This will display the Text Import Wizard from where you can set up how you want your Text file’s data to be displayed in Excel (as shown in method 1).

Text Import Wizard

You should now see your text file converted and displayed in Excel.  

Final data in Excel

Once the file opens, if you still find some of the columns (or individual cells) not converted to your required format, you can convert them manually.

While this method to open the Text file directly in Excel works well, the benefit of using the first method (using Text Import Wizard) allows you to make some adjustments even before getting the data in Excel.

In this tutorial, we showed you two ways to convert and open a Text file in Excel.

A third method could be by using online tools like Online2pdf, but we did not dwell too much on this because Excel’s Text Import Wizard provides much more flexibility, allowing you to adjust your data, and format them exactly how you want them.

We hope this tutorial was helpful for you.

Other Excel tutorials you may also like:

  • How to Convert a CSV File to Excel?
  • How to Open VCF File in Excel?
  • How to Open Excel File [xls, xlsx] Online (for FREE)
  • Why does Excel Open on Startup (and How to Stop it)
  • How to Make Excel File Read Only
  • How to Insert an Excel file into MS Word
  • How to Save Selection in Excel as PDF (3 Easy Methods)
  • How to Merge Two Excel Files?
  • How to Convert PDF to Excel without Software?
  • How to Open DAT Files in Excel?

На онлайн курсах Excel, проводимых мной по Skype, я объясняю не только принципы создания таблиц в самом Excel, но и интеграцию данной программы пакета Microsoft Office с другими программами. В частности, рассматривается вопрос обмена данными.

Смотрите видео после статьи

видео может дополнять статью или содержать её полностью

Как известно, часто встречаются случаи, когда данные для обработки уже есть. В этом случае требуется их поместить на лист Excel и обработать нужным образом. Самый плохой вариант — перепечатать вручную. На самом деле это в большинстве случаев не нужно, поскольку можно использовать функции импорта данных, встроенные в Excel.

Если вы пользуетесь программой 1С, то вам также будет полезно узнать как сделать экспорт данных в Excel из 1С.

Когда допустимо использовать импорт в Excel

Далеко не всегда. Дело в том, что любой лист Excel состоит из отдельных ячеек, а значит данные из внешнего источника нужно вставить на лист так, чтобы они нужным образом расположились в ячейках. Как подсказывает логика, это возможно только в том случае, когда импортируемые данные имеют вполне определённую структуру. Например, это могут быть регулярно повторяющиеся блоки данных (строки).

Если данные не имеют выраженной структуры, то автоматизировать процесс их импорта в Excel не получится.

Пример хорошо структурированных данных показан на рисунке ниже (текст в блокноте).

Импорт текста в Excel

[нажмите на картинку для увеличения]

Справка: как сохранять фото с сайтов

В данном примере текст разделён на столбцы и строки. Также обратите внимание на то, что в качестве разделителей целой и дробной частей чисел везде использована запятая. Если бы использовалась то точка, то запятая, пришлось бы предварительно привести текст к некоторому единообразию посредством поиска и замены.

Как использовать мастер импорта текста в Excel

Чтобы преобразовать таблицу в блокноте в таблицу Excel, копируем текст и вставляем его на лист Excel. При этом получается следующая картина.

Импорт текста в Excel

[нажмите на картинку для увеличения]

Справка: как сохранять фото с сайтов

Оставлять в таком виде таблицу нельзя. Нажимаем на значок меню в правом нижнем углу и выбираем пункт «Использовать мастер импорта текста«. Назначение данного инструмента — указать Excel, как именно структурирован вставляемый текст, чтобы программа могла его разбить на ячейки так, как нам нужно (если значок пропал, то просто отменить вставку и повторить заново).

Импорт текста в Excel

[нажмите на картинку для увеличения]

Справка: как сохранять фото с сайтов

В нижней части окна отображается текст, структуру которого мы пока ещё не объяснили программе. Именно поэтому он выглядит не так, как нужно. Сразу можно заметить, что заголовок таблицы отличается по форматированию от данных под ним, поскольку вместе с пробелами (или табуляциями) там есть ещё символы «->». Строка под заголовком также нам не нужна, поэтому начинаем импорт с третьей строки. И переходим к следующему шагу в мастере импорта текста.

Импорт текста в Excel

[нажмите на картинку для увеличения]

Справка: как сохранять фото с сайтов

Здесь потребуется указать, какой символ (или символы) является разделителем столбцов в таблице, скопированной из блокнота. В данном случае я определил, что это табуляция, причём, как правило, несколько, поэтому настройки будут выглядеть так, как показано на рисунке выше.

Вопрос: а вы умеете различать символы табуляции и пробел? (я имею ввиду уже кем-то написанный текст!). На онлайн курсах Word мы это разбираем.

Нажимаем Далее и переходим к следующему шагу.

Импорт текста в Excel

[нажмите на картинку для увеличения]

Справка: как сохранять фото с сайтов

На заключительном этапе требуется указать тип данных в каждом столбце. По умолчанию — Общий. Какой тип данных указывать, зависит от того, что в столбцах, а также для чего потом будет использоваться эта таблица. Я это подробно рассматриваю на курсах Microsoft Excel. Сейчас для простоты данный шаг просто пропускаю, поскольку в данном случае (почему?) это не обязательно. В результате получим следующее.

Импорт текста в Excel

[нажмите на картинку для увеличения]

Справка: как сохранять фото с сайтов

Добавим заголовок (можно также импортом, а можно вручную) и отформатируем таблицу. И вот конечный результат.

Импорт текста в Excel

[нажмите на картинку для увеличения]

Справка: как сохранять фото с сайтов

Подведём итоги

Функция импорта текста в Microsoft Excel позволяет экономить время при создании таблиц в том случае, если данные для таблицы уже есть в другой программе.

Уникальная метка публикации: 73E6AC6D-8C0B-9484-3676-3590E5F10B3F
Источник: //artemvm.info/information/uchebnye-stati/microsoft-office/import-teksta-v-excel/

See all How-To Articles

This tutorial demonstrates how to open a text file in Excel and Google Sheets.

converttxt intro

Open Text File in Excel

  1. In the Ribbon, select File > Open > Browse, and then select the text or CSV file to be opened.
    The Text Import Wizard opens to the first of three steps.

Convert Step1

  1. Depending on the data contained in the file selected, you can either choose Delimited or Fixed Width as the file type. If the data is separated with a character like a comma, semicolon, space, or tab, select Delimited. If the first row of data contains column headings, check My data has headers.
  2. Click Next.

Convert Step2

  1. In Step 2, select the type of delimiters contained in the text file – in this case the tab delimiter. Then select the text qualifier. In some cases, the data may be enclosed in quotes, but for this example, (none) is selected as the text qualifier.
  2. Click Next.

Convert Step3

  1. The final step of the text import wizard allows you to specify the data type contained in each column. Most of the time, Excel is able to determine the data type automatically, and you can leave the selected Column data format on General.
  2. Click Finish to import the data into Excel.

Convert Text File

Import Text File Using Get Data

An alternative way of importing data into Excel from a text file, is to use the Get and Transform Data feature.

  1. In the Ribbon, select Data > Get and Transform Data > From Text/CSV.

Convert GetData Ribbon

  1. Select the file to be imported, and then click Import.
  2. The file appears in a dialog box with the delimiter already automatically selected, and the text divided by Excel according to the data stored in the text file. Click Load to load the data into Excel.

Convert LoadData

The data now appears in a new sheet in Excel. There are now two new tabs on the RibbonTable Design and Query – as well as a Queries & Connections pane appearing on the right-hand side of the screen. This shows that the data is linked to the TXT file and if any data in the TXT file was to change (external to Excel), the data displayed in Excel would change too.

Convert GetData LinkedData

  1. To unlink the imported data from the external TXT file, in the Ribbon, select Table Design > External Table Data > Unlink.

Convert GetData Unlink

  1. The data is imported into Excel as a table. To convert it to a standard Excel range, in the Ribbon, select Table Design > Tools > Convert to Range.

Convert GetData ConvertToRange

Both the Table Design and Query tabs on the Ribbon disappear.

Open Text File in Google Sheets

  1. From the File menu in Google Sheets, select Import.

Convert GS ImportMenu

  1. Click Upload, and then click on the blue Select a file from your device button to select the required file.

Convert GS Upload

The name of the file to be imported is displayed under File with the default options available for importing automatically selected.

converttxt importfilename

  1. To change the Import Location, click the drop-down list under Import Location and select the option required.

converttxt importlocation

To change the Separator type, click the drop-down list on the right and select a character to delineate by.

converttxt importdelimiter

  1. Keep Convert text to numbers, dates, and formulas checked and then click Import Data to import the file into a new Google sheet.

converttxt opennow

  1. Click Open now.

converttxt gs final

Перейти к содержанию

На чтение 2 мин Опубликовано 21.06.2015

  • Импорт
  • Экспорт

Эта статья описывает, как импортировать или экспортировать текстовые файлы. Текстовые файлы могут быть разделены запятыми (.csv) или знаками табуляции (.txt).

Импорт

Чтобы импортировать текстовые файлы, следуйте нашей инструкции:

  1. На вкладке File (Файл) кликните Open (Открыть).
  2. Из выпадающего списка выберите Text Files (Текстовые файлы).Импорт и экспорт текста в Excel
  3. Чтобы импортировать файл …
    • CSV, выберите документ с расширением .csv и нажмите кнопку Open (Открыть). Это всё.
    • TXT, выберите документ с расширением .txt и кликните по Open (Открыть). Excel запустит Text Import Wizard (Мастер текстов (импорт)).
  4. Выберите Delimited (С разделителями) и нажмите Next (Далее).Импорт и экспорт текста в Excel
  5. Уберите все галочки кроме той, что напротив Tab (Знак табуляции) и кликните Next (Далее).Импорт и экспорт текста в Excel
  6. Нажмите Finish (Готово).Импорт и экспорт текста в Excel

Результат:

Импорт и экспорт текста в Excel

Экспорт

Чтобы экспортировать книгу Excel в текстовый файл, сделайте следующее:

  1. Откройте документ Excel.
  2. На вкладке File (Файл) нажмите Save As (Сохранить как).
  3. Из выпадающего списка выберите Text (Tab delimited) (Текстовые файлы (с разделителями табуляции)) или CSV (Comma delimited) (CSV (разделители – запятые)).Импорт и экспорт текста в Excel
  4. Нажмите Save (Сохранить).

Результат: CSV файл (разделенный запятыми) и TXT файл (разделённый знаками табуляции).

Импорт и экспорт текста в Excel Импорт и экспорт текста в Excel

Оцените качество статьи. Нам важно ваше мнение:

Like this post? Please share to your friends:
  • Text highlighting colors in word
  • Text highlight in excel
  • Text file for excel
  • Text going up and down in word
  • Text file convert to excel file