Windows batch command(s) to read first line from text file

Jesse Vogt picture Jesse Vogt · Sep 24, 2008 · Viewed 331.9k times · Source

How can I read the first line from a text file using a Windows batch file? Since the file is large I only want to deal with the first line.

Answer

Spaceballs picture Spaceballs · Oct 19, 2011

uh? imo this is much simpler

  set /p texte=< file.txt  
  echo %texte%