Search found 4316 matches

by Squashman
14 Feb 2022 11:36
Forum: DOS Batch Forum
Topic: Batch file to merge two column strings from two files into one file
Replies: 4
Views: 5415

Re: Batch file to merge two column strings from two files into one file

Code: Select all

@echo off
setlocal enabledelayedexpansion
< file2.txt ( FOR /F "delims=" %%G IN (file1.txt) DO (
set /p file2=
echo %%G !file2!
)
)>combined.txt
by Squashman
10 Feb 2022 23:03
Forum: DOS Batch Forum
Topic: Check which of many network domains the current machine is in then run a script
Replies: 8
Views: 7146

Re: Check which of many network domains the current machine is in then run a script

Batch files execute each line in the script from top to bottom. Regardless of the goto, once the for command is done executing it is going to execute the next command in the script.
by Squashman
08 Feb 2022 22:22
Forum: DOS Batch Forum
Topic: Find data in an external database with Batch
Replies: 3
Views: 4417

Re: Find data in an external database with Batch

Three quarters of your problem is not even batch file related. The majority of your knowledge deficit is making the DB queries to verify the data. This forum is not a DB forum. If you need help with the DB queries you will need to ask on another site.
by Squashman
07 Feb 2022 21:48
Forum: DOS Batch Forum
Topic: Batch file to delete specific files on multiple folders
Replies: 2
Views: 4262

Re: Batch file to delete specific files on multiple folders

Like your question over on StackOverFlow , I find your technical requirements vague and incomplete. You need to be very specific and provide accurate details of everything.
by Squashman
06 Feb 2022 10:01
Forum: DOS Batch Forum
Topic: How to spool batch script logic to create another batch script but not expanded?
Replies: 5
Views: 5522

Re: How to spool batch script logic to create another batch script but not expanded?

And here is where we discussed with you about escaping the parentheses. https://www.dostips.com/forum/viewtopic.php?t=8282 I bet if I do another search I will find another thread of yours where we explained escaping the percent symbols. Regardless this site has discussed escaping the percent symbol ...
by Squashman
30 Jan 2022 18:43
Forum: DOS Batch Forum
Topic: goto-jump destroys for-vars/loop
Replies: 1
Views: 3141

Re: goto-jump destroys for-vars/loop

Batch file process from the top down. Once you break out of the FoR construct it finds the label from the top down and starts processing line by line again. If you need to break out of something without breaking the loop then use the CALL command to spawn out to a separate function.
by Squashman
30 Jan 2022 12:41
Forum: DOS Batch Forum
Topic: search for previous item
Replies: 19
Views: 13780

Re: search for previous item

May I enter the timing test contest? 8) find the file at row 99045 C:\BatchFiles\DOSTIPS\10362>TIMETHIS.EXE Antonio.bat E:\19004.zip TimeThis : Command Line : Antonio.bat TimeThis : Start Time : Sun Jan 30 12:39:45 2022 TimeThis : End Time : Sun Jan 30 12:40:14 2022 TimeThis : Elapsed Time : 00:00:...
by Squashman
30 Jan 2022 11:42
Forum: DOS Batch Forum
Topic: Find text string in TXT hosted on Server.
Replies: 11
Views: 9486

Re: Find text string in TXT hosted on Server.

So if you have files on another computer on your network how do you get to them?

(Teaching you to fish)
by Squashman
30 Jan 2022 10:22
Forum: DOS Batch Forum
Topic: Find text string in TXT hosted on Server.
Replies: 11
Views: 9486

Re: Find text string in TXT hosted on Server.

So you know the name of the server. You know the severs ip address. You know the name of the file you need to search. You know what the search string is. What is your problem?
by Squashman
30 Jan 2022 10:18
Forum: DOS Batch Forum
Topic: Insert Text in Second Last Line of .xml
Replies: 6
Views: 4363

Re: Insert Text in Second Last Line of .xml

To me it does not seem to be escaping the / in </menu>, therefore its excluding any line with menu in it? What made you think you needed to escape anything in the search string using the find command? The help syntax does not reference it at all. If you read the help for the findstr command then in...
by Squashman
29 Jan 2022 14:06
Forum: DOS Batch Forum
Topic: search for previous item
Replies: 19
Views: 13780

Re: search for previous item

New code. @echo off &setlocal set "file=filearchive2.txt" set "search=doc190049.pdf" for /f "usebackq tokens=1,2,* delims= " %%G in (`findstr /IC:"#" /IC:"%search%" "%file%"`) do ( if /I "%%G"=="#" ( set "archive=%%I" ) ELSE ( FOR /F "tokens=1,2,* delims= " %%J in ("%%I") DO ( IF /I "%%L"=="%search%...
by Squashman
29 Jan 2022 13:30
Forum: DOS Batch Forum
Topic: search for previous item
Replies: 19
Views: 13780

Re: search for previous item

this is exactly real word 2015-01-03 22:31 4490416 4490416 d:\zipfile1.7z # Archivio d:\zipfile1.7z 2015-01-01 22:51 56091 56369 file1.pdf 2015-01-01 22:51 14975 14479 file2.pdf # Fine dell'archivio 2015-01-03 22:31 4490416 4490416 d:\zipfile2.7z # Archivio d:\zipfile2.7z 2015-01-02 23:21 14576321 ...
by Squashman
29 Jan 2022 13:09
Forum: DOS Batch Forum
Topic: search for previous item
Replies: 19
Views: 13780

Re: search for previous item

this is exactly real word 2015-01-03 22:31 4490416 4490416 d:\zipfile1.7z # Archivio d:\zipfile1.7z 2015-01-01 22:51 56091 56369 file1.pdf 2015-01-01 22:51 14975 14479 file2.pdf # Fine dell'archivio 2015-01-03 22:31 4490416 4490416 d:\zipfile2.7z # Archivio d:\zipfile2.7z 2015-01-02 23:21 14576321 ...
by Squashman
29 Jan 2022 12:05
Forum: DOS Batch Forum
Topic: search for previous item
Replies: 19
Views: 13780

Re: search for previous item

darioit wrote:
29 Jan 2022 11:59
@Squashman slowly but can't find a zip match, sorry
I will disagree. It finds the matches based on your provided data. If it did not find a match then your provided data is not what you gave as an example.
by Squashman
29 Jan 2022 11:47
Forum: DOS Batch Forum
Topic: search for previous item
Replies: 19
Views: 13780

Re: search for previous item

Another option. Probably not as fast as aGerman's solution. Don't have a big file to test with us. echo off &setlocal set "file=filearchive.txt" set "search=doc3.pdf" for /f "usebackq tokens=1,* delims= " %%G in ("%file%") do ( if /I "%%G"=="#Archivio" ( set "archive=%%H" ) ELSE ( FOR /F "tokens=1,2...