Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What delimiter to use in FOR loop for reading lines?

I have a txt file that contains the following lines

jfo3 93jfl
lvls 29fdj
nskd jfuwe
xlkw eklwe

I'm trying to read the file line by line, and do something with it. What delimiter should I use?

The delim I'm using here reads each word separately.

@echo off
setlocal EnableDelayedExpansion
for /f "delims=" %%x in (lines.txt) do (
    echo %%x
)
like image 405
sameold Avatar asked Jul 17 '11 04:07

sameold


1 Answers

This reads line by line for me:

for /f "delims=" %x in (lines.txt) do echo %x
like image 68
Moe Matar Avatar answered Sep 23 '22 00:09

Moe Matar