Computing.Net > Forums > Programming > delete text batch file

delete text batch file

Reply to Message Icon

Original Message
Name: emaluzer
Date: March 21, 2008 at 17:22:27 Pacific
Subject: delete text batch file
OS: xp
CPU/Ram: 2.8ghz /2gb
Model/Manufacturer: dell
Comment:

I have a batch file that copies the date and pastes it to a text. the text shows the date as day mm/dd/yy. I need the bat to delete the day that appears at the begining. I thought of using find or findstr commands but am not sure how to delete the day (mon, tue, wed, etc.) Here is my code:

@echo on
date /T > c.txt
findstr Wed c.txt
type c.txt >>d.txt
:end
cls


Report Offensive Message For Removal

Response Number 1
Name: Mechanix2Go
Date: March 22, 2008 at 02:41:51 Pacific
Subject: delete text batch file
Reply: (edit)

::== dd.bat

@echo off
setLocal EnableDelayedExpansion

for /f "tokens=1* delims= " %%a in ('date /t') do (
echo %%b > d.txt
)

::== end of dd.bat


=====================================
If at first you don't succeed, you're about average.

M2


Report Offensive Follow Up For Removal

Response Number 2
Name: klint
Date: March 22, 2008 at 10:24:31 Pacific
Subject: delete text batch file
Reply: (edit)

Another way to do it is to go into Regional Settings in Control Panel and tell it not to display the day of the week.


Report Offensive Follow Up For Removal

Response Number 3
Name: emaluzer
Date: March 23, 2008 at 18:56:27 Pacific
Subject: delete text batch file
Reply: (edit)

Thank YOu mechanix2go! That did the trick!


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: delete text batch file

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software