none
Reading a Word Document Through the Windows Command Line

    Question

  • Does anybody know if there is a way to read .txt files through the windows command line? On Linux, you can simply use the cat, head or tail command to read the document, but those Linux commands do not work with the Windows command prompt. If anybody know the equivalent to those commands on Windows, help would be much appreciated. Thanks in advance for the help.


    • Moved by Just KarlModerator Thursday, August 4, 2016 3:22 PM Looking for the correct forum.
    Wednesday, August 3, 2016 11:17 PM

Answers

All replies

  • Hello,

    The 'Academic Initiatives - Technical Queries' forum is for posts Related to technical / coding / programming related issues as related to Microsoft's Academic Initiatives.

    As it's off-topic here, I am moving the question to the Where is the forum for... forum.

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    Thursday, August 4, 2016 3:19 PM
    Moderator
  • Hello,

    Depending on the OS you can use Windows PowerShell as:

    Get-Content <path to file.txt> |more

    OR - in Windows 10 PowerShell:

    cat <path to file.txt> -Head 5 (Where 5 returns the first 5 lines)

    cat <path to file.txt> -Tail 5 (Where 5 returns the last 5 lines)

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})


    Thursday, August 4, 2016 3:22 PM
    Moderator
  • You can also use type in CMD.

    http://ss64.com/nt/type.html


    Thursday, August 4, 2016 3:40 PM