Thursday, October 19, 2017

Connect to a Text file (Power Query)

Connect to a Text file (Power Query)

Note: Power Query is known as Get & Transform in Excel 2016. Information provided here applies to both. To learn more, see Get & Transform in Excel 2016.

Note: For a very quick video on how to display Query Editor, see the end of this article.

Connect to a text file from Power Query

  1. In the Power Query ribbon tab, click From File > From Text.

  2. In the Browse dialog box, browse for or type a file path to import or link to a file.

After the connection succeeds, you will be able to preview the lines of text in the file.

Formula Example

= Table.FromColumns({Lines.FromBinary(File.Contents("C:\sample.txt"),null,null,1252)})

Note: The Query Editor only appears when you load, edit, or create a new query using Power Query. The following video shows the Query Editor window appearing after editing a query from an Excel workbook. To view the Query Editor without loading or editing an existing workbook query, from the Get External Data section in the Power Query ribbon tab, select From Other Sources > Blank Query. The following video shows one way to display the Query Editor.

How to see Query Editor in Excel

No comments:

Post a Comment