Search found 1160 matches
- 08 Sep 2013 18:23
- Forum: DOS Batch Forum
- Topic: Rename text file based on content
- Replies: 31
- Views: 26505
Re: Rename text file based on content
You should be able to take Aacini's code and replace both instances of set line3= for /F "usebackq skip=2 delims=" %%a in ("%%f") do if not defined line3 set "line3=%%a" with set /p line1=<%%f but I haven't tested it, and honestly I'm just now discovering that batch can...
- 08 Sep 2013 17:32
- Forum: DOS Batch Forum
- Topic: Rename text file based on content
- Replies: 31
- Views: 26505
Re: Rename text file based on content
First line stuff is easy; you can just say
which will store the first line in the text file to %variable%
Code: Select all
set /p variable=<filename.txt
which will store the first line in the text file to %variable%
- 06 Sep 2013 22:46
- Forum: DOS Batch Forum
- Topic: Batch File for Word Docs
- Replies: 8
- Views: 8449
Re: Batch File for Word Docs
You can take advantage of the fact that a .docx file is essentially a container like a .rar file and can be opened by a file archival program like WinRAR or 7Zip that has a command line interface and extract the files inside, grab the docProps\core.xml file, change the value inside the dc:creator ta...
- 06 Sep 2013 22:20
- Forum: DOS Batch Forum
- Topic: Batch File for Word Docs
- Replies: 8
- Views: 8449
Re: Batch File for Word Docs
Like foxidrive said earlier, batch files can't read Word documents. If you absolutely, positively must have Word documents, I'd recommend trying something with Visual Basic macros because that's what's built into Word. However, if you can put both the list of names and the form in text documents, th...
- 06 Sep 2013 21:39
- Forum: DOS Batch Forum
- Topic: Batch File for Word Docs
- Replies: 8
- Views: 8449
Re: Batch File for Word Docs
I'm very confused by what you're asking for. Here is how I interpret what you've said so far - please correct me: You have a file that contains a list of 200 names (I assume one on each line, but I suppose they could also be comma-delimited or something). You have a Word document that contains... so...