Computing.Net > Forums > Disk Operating System > Batch file help...

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

Batch file help...

Reply to Message Icon

Original Message
Name: lamadonkey
Date: November 26, 2003 at 02:13:10 Pacific
Subject: Batch file help...
OS: Win 2000
CPU/Ram: pentium II / 96mb.
Comment:

I'm working on a batch file that will search an input file containing entries of (act,pmt,dps). What I want to do is search this document for those entries and send them to seperate text file.

For instance all "act" entries would be sent to act.txt. I found two ways of doing this. One is rather long. (%1 would be name of the input file that would be entered with batch file. %2 would be three letters of the day... MON,TUE...)

FIND /i "act" D:\lama\%1 > D:\lama\%2ACT.txt

Basically I would do that three times. One for each entry. Then I tried this... which... seems completely messed up but works.

FOR %%A IN (DEP,ACT,PMT) DO FIND /i "%%A" D:\student\%1 >D:\student\%2%%A.txt

My question is does anyone know of a better way of accomplishing this. Thanks in advance. (And yeah i know it seems stupid asking for help with something I have two ways of doing.)



Report Offensive Message For Removal


Response Number 1
Name: dtech10
Date: November 26, 2003 at 14:41:36 Pacific
Reply: (edit)

Hi
doe's the input file name ie %1 apply to
the same file each time, and %2 refer to the current weekday.
What format of the date do you get when typing echo %date% produce. ie does it inclue the weekday.



Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge
Poll History




Data Recovery Software