Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Batch Stop when met %  (Read 2186 times)

0 Members and 1 Guest are viewing this topic.

simonchin

  • Guest
Batch Stop when met %
« on: March 16, 2007, 06:13:11 PM »
Hi,

Hope can get some help in this...
A simple For loop:

@Echo off
Setlocal Enabledelayedexpansion

For /F "Delims=, UseBackq" %%i IN ("PC LOG_03162030.csv") DO (
      Set /A Count=Count+1
      Echo !Count! %%i
      )

Pause

My problem is when text or csv contains any % symbols, my for loop will stop.
Have tried to find out some details from the forum, but can't get a right words to search.
Anyway to handle this? I am tired changing % to Percent...

Thanks in advance.


WillyW



    Specialist
  • Thanked: 29
  • Experience: Experienced
  • OS: Windows XP
Re: Batch Stop when met %
« Reply #1 on: March 17, 2007, 09:06:19 AM »
I don't know if this will work for you or not,  but it will only take you a minute to read it and decide:

http://www.computerhope.com/jargon/e/esc.htm

Look for this part:  
Quote
An escape enables a user to perform a special function or to have a character treated as plain text and not a function.

.