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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

delete text batch file

Reply to Message Icon

Name: emaluzer
Date: March 21, 2008 at 17:22:27 Pacific
OS: xp
CPU/Ram: 2.8ghz /2gb
Product: 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



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: March 22, 2008 at 02:41:51 Pacific
Reply:

::== 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


0

Response Number 2
Name: klint
Date: March 22, 2008 at 10:24:31 Pacific
Reply:

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.


0

Response Number 3
Name: emaluzer
Date: March 23, 2008 at 18:56:27 Pacific
Reply:

Thank YOu mechanix2go! That did the trick!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: delete text batch file

batch file delete itself www.computing.net/answers/programming/batch-file-delete-itself/17243.html

self destruct batch file ? www.computing.net/answers/programming/self-destruct-batch-file-/17288.html

Batch file waits for Notepad www.computing.net/answers/programming/batch-file-waits-for-notepad/13205.html