Computing.Net > Forums > Programming > batch to search in .txt and rename

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.

batch to search in .txt and rename

Reply to Message Icon

Name: ComradeZhukov
Date: October 30, 2008 at 13:15:49 Pacific
OS: XP
CPU/Ram: AMD Athlon
Product: x
Comment:

Hello guys!
I need help to make a bat file that do search inside test.txt for the word "time" and renames that .txt like this: test_time.txt




Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: October 30, 2008 at 14:41:03 Pacific
Reply:

find "time" test.txt > nul && ren test.txt test_time.txt


0

Response Number 2
Name: ComradeZhukov
Date: October 31, 2008 at 00:41:34 Pacific
Reply:

Sorry, may be i explained not good, english is not my native.. i'll try again.

So, i need to search something inside .txt file, then i need that search results to be added into a file name:
filename.txt ==> filename_searchresults.txt


0

Response Number 3
Name: klint
Date: October 31, 2008 at 03:08:32 Pacific
Reply:

for /f "delims=" %%a in ('find "time" ^< test.txt') do ren test.txt "test_%%a.txt"


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: batch to search in .txt and rename

Batch to search all drives and copy newest www.computing.net/answers/programming/batch-to-search-all-drives-and-copy-newest/20316.html

Batch to search in multiple files www.computing.net/answers/programming/batch-to-search-in-multiple-files/16928.html

Dos script search in .txt file P-2 www.computing.net/answers/programming/dos-script-search-in-txt-file-p2/16746.html