for loop - Batch File - Delimiter for multiple spaces -


I am trying to isolate each token from a txt document, and echo out every word is the problem Each token has a different amount between them. For example:

Administrators ____________ user 1 ________________ Guest

"_" represent each one place, formerly. There are 12 locations between 1 user and user between administrator and user of 1 and 16 spaces.

How can I use a batch script to separate each one of these if:

1) The file is "C: \ Usernames.txt" 2) They are all on the first line of the txt file

I have tried:

  FOR / F "Delims ="% A IN (C: \ Usernames.txt) IOO % A  

And whatever I get is "Admin" resonates. Any help is greatly appreciated. Thanks!

EDIT:

Due to throwing the loop in the loop, I could get a little closer. My code was

  FOR / F "delims ="% A IN (C: \ Usernames.txt)% B IN (% A) DO ECHO% B  

This allows me to echo in 4 parts, although I need three. I got it:

  admin, user, 1, guest  

How can I create this user and join 1 user?

This can work: it depends on having at least two places between each username And that two consecutive spaces in the username

  Pure user | Search "" | Repl "{2,50}" "\ r \ n" x  

This uses an assisted batch file which is called repl.bat (by dbenham) - Download:

Place repl.bat in the same folder on the path in the batch file or folder.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -