Search found 189 matches

by goodywp
17 Jul 2018 08:17
Forum: DOS Batch Forum
Topic: How to Create a File List with some modification using Simple Batch File
Replies: 9
Views: 1691

How to Create a File List with some modification using Simple Batch File

Hi all, I search up on internet to create a file list all the files and folders in a plain txt file as below code dir /b > fileslist.txt I used the below code to test my case and it did perfectly as below: @echo off cd C:\auto_pkg_build\Workspace\Build_pkg\T592-08878-0101_Link2500_TCPX_NARInfra_GEN_...
by goodywp
16 Jul 2018 06:58
Forum: DOS Batch Forum
Topic: batch job to do string replacement of contents.lst file in all subfolders
Replies: 4
Views: 1255

Re: new job to do a batch of replacement of contents.lst

I tried use below code and end up after line 22 11 22 The system cannot find the path specified. C:\auto_pkg_build\Workspace\Build_pkg\T592-08878-0101_Link2500_TCPX_NARInfra_GEN _PROD\T592-08878-0101\*, Are you sure (Y/N)? @Echo Off SETLOCAL EnableDelayedExpansion call C:\auto_pkg_build\Scripts\sche...
by goodywp
13 Jul 2018 11:47
Forum: DOS Batch Forum
Topic: batch job to do string replacement of contents.lst file in all subfolders
Replies: 4
Views: 1255

Re: new job to do a batch of replacement of contents.lst

I would parse the output of the DIR command with a FOR /F command to get a listing of all the files. FOR /F "delims=" %%G IN ('dir /a-d /b /s contents.lst') DO........ Thanks and tried this following code not working as expected for all subfolders' replacement @Echo Off call C:\auto_pkg_build\Scrip...
by goodywp
12 Jul 2018 13:35
Forum: DOS Batch Forum
Topic: batch job to do string replacement of contents.lst file in all subfolders
Replies: 4
Views: 1255

batch job to do string replacement of contents.lst file in all subfolders

Hi all, I have a new task to do a batch job to replace all subfolders's contents.lst files Here is the example: C:\level1\level2\level3 \level3a\level4 \level4a\level5 \level3b Now the requirement is that under level2 folder, there is a contents.lst file which mainly display the list of files and fo...
by goodywp
12 Jul 2018 08:34
Forum: DOS Batch Forum
Topic: How to freely select one column based on another column data?
Replies: 17
Views: 4461

Re: How to freely select one column based on another column data?

I had some issue for this code. It was OK when the column is not that much. But now after adding more column and getting some weird issue, for some column I got the error back again Here is my config file MOCKUP_DL QA_DL US_PROD_DL TD_DL GPC_DL ELAVON_DL DESJAR_DL CA_PROD_DL . . . . . my source col...
by goodywp
28 Jun 2018 15:26
Forum: DOS Batch Forum
Topic: How to freely select one column based on another column data?
Replies: 17
Views: 4461

Re: How to freely select one column based on another column data?

The input example and code example you have given does not produce that error. PERIOD! strange on my PC keep giving me error but if I switch to TD_DL or US_PROD_DL they both OK.... :cry: Create a zip file with your batch file and all your input files and attach the zip file to a post. Tried another...
by goodywp
28 Jun 2018 14:47
Forum: DOS Batch Forum
Topic: How to freely select one column based on another column data?
Replies: 17
Views: 4461

Re: How to freely select one column based on another column data?

Squashman wrote:
28 Jun 2018 14:41
goodywp wrote:
28 Jun 2018 14:40
Now the issue I raised here if my target is CA_PROD_DL, it got error as above....
Thanks again
The input example and code example you have given does not produce that error. PERIOD!
strange on my PC keep giving me error but if I switch to TD_DL or US_PROD_DL they both OK.... :cry:
by goodywp
28 Jun 2018 14:40
Forum: DOS Batch Forum
Topic: How to freely select one column based on another column data?
Replies: 17
Views: 4461

Re: How to freely select one column based on another column data?

Really appreciated your effort!! My original requirement was this as below if I have two scheme pack under QA_DL, T501-08815-0103 0501-08783-0102 if my target is MOCKUP_DL, then it will find T501-08680-0103 0501-08690-0102 if my target is TD_DL, then it will pop up T501-08665-0103 0501-08658-0102 an...
by goodywp
28 Jun 2018 13:29
Forum: DOS Batch Forum
Topic: How to freely select one column based on another column data?
Replies: 17
Views: 4461

Re: How to freely select one column based on another column data?

If the new requirement is that the source data can be at any column, then it is equivalent to say that not matters in which column is it, right? So you just need to eliminate the /B switch from FINDSTR command... This should work as long as there is not duplicate data in more than one column. The B...
by goodywp
28 Jun 2018 13:25
Forum: DOS Batch Forum
Topic: How to freely select one column based on another column data?
Replies: 17
Views: 4461

Re: How to freely select one column based on another column data?

I had some issue for this code. It was OK when the column is not that much. But now after adding more column and getting some weird issue, for some column I got the error back again Here is my config file profile_scheme.txt file as below, originally I had , between two column, but after remove it st...
by goodywp
22 Jun 2018 14:20
Forum: DOS Batch Forum
Topic: Way to replace string in word DOC ?
Replies: 12
Views: 2221

Re: Way to replace string in word DOC ?

aGerman wrote:
22 Jun 2018 13:01
Just use the %wordrepl% macro twice in your script. Follow the link in the Usage comment to learn more about the capabilities of a single call.

Steffen
Yes!! works perfectly...
by goodywp
22 Jun 2018 11:46
Forum: DOS Batch Forum
Topic: Way to replace string in word DOC ?
Replies: 12
Views: 2221

Re: Way to replace string in word DOC ?

It doesn't matter if you saved the document as .doc or as .docx as long as you specify the same file name and extension in the script. But why did you save the document in the program files directory? Usually you'd need elevated permissions to do any write operations there (and saving the changed f...
by goodywp
22 Jun 2018 11:41
Forum: DOS Batch Forum
Topic: Way to replace string in word DOC ?
Replies: 12
Views: 2221

Re: Way to replace string in word DOC ?

Squashman wrote:
22 Jun 2018 09:22
Don't try and read and write to any type of system or Program Files folder. You need elevated privileges to do that.
Thanks for your reminding. I just a temporary used for a testing. Did the rest on another folder.
by goodywp
22 Jun 2018 08:50
Forum: DOS Batch Forum
Topic: Way to replace string in word DOC ?
Replies: 12
Views: 2221

Re: Way to replace string in word DOC ?

I found some kind of bug in the return value of the Find.Execute method that makes the return value of the script rather ambiguous. E.g if you have the word abcx in your document and you want to replace abc , but only the whole word (using option /w). The Execute method returns true because it foun...
by goodywp
21 Jun 2018 07:43
Forum: DOS Batch Forum
Topic: which wildcard can be used in this case??
Replies: 13
Views: 3189

Re: which wildcard can be used in this case??

You can use this to rename: Setlocal enable delayedexpansion For %%i in (*.doc) do ( set "filename=%%~nxi" Set "filename=!filename: =_!" Ren "%%i" "!filename!" rem do something ) I can't see what content your variable is. Phil Thanks Phil! for making less hard coding. However we still need define t...