Search found 198 matches

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

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

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

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

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

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

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

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

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

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...
by goodywp
21 Jun 2018 07:39
Forum: DOS Batch Forum
Topic: which wildcard can be used in this case??
Replies: 13
Views: 4392

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

for %%f in ("C:\auto_pkg_build\Sources\Source_pkg\%opkg%\%optn%\Factory Download\TETRA\TELIUM3\%VAR14%\Schemes?to?Sign_for_%VAR001%.doc") do ( rename %%f Schemes_to_Sign_for_%VAR001%.doc Does this above command valid? rename %%f Schemes_to_Sign_for_%VAR001%.doc As I alluded to in my previous commen...
by goodywp
20 Jun 2018 12:50
Forum: DOS Batch Forum
Topic: which wildcard can be used in this case??
Replies: 13
Views: 4392

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

OK, I think I had several try and get what I need for. Here is the one: cd "C:\auto_pkg_build\Sources\Source_pkg\%opkg%\%optn%\Factory Download\TETRA\TELIUM3\%VAR14%\" if exist *.doc ( rename *.doc Schemes_to_Sign_for_%VAR001%.doc So in this way, I can make sure the file format is always has undersc...
by goodywp
20 Jun 2018 09:33
Forum: DOS Batch Forum
Topic: which wildcard can be used in this case??
Replies: 13
Views: 4392

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

If you don't need to access the matched file or know the exact file name, then using wildcard in combination with `IF` statement would suffice, but if there is a need to access the file afterwards (read contents of, know the exact file name, pass the file name to another program,...) then `FOR` sta...
by goodywp
20 Jun 2018 08:44
Forum: DOS Batch Forum
Topic: which wildcard can be used in this case??
Replies: 13
Views: 4392

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

If you don't need to access the matched file or know the exact file name, then using wildcard in combination with `IF` statement would suffice, but if there is a need to access the file afterwards (read contents of, know the exact file name, pass the file name to another program,...) then `FOR` sta...
by goodywp
20 Jun 2018 08:40
Forum: DOS Batch Forum
Topic: which wildcard can be used in this case??
Replies: 13
Views: 4392

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

Squashman wrote:
20 Jun 2018 07:08
A question mark for a single character.
Here is a good read for you.
viewtopic.php?t=6207
I tried it and not working. probably as sst said that I need to access the file...

Thanks anyway..
by goodywp
20 Jun 2018 06:17
Forum: DOS Batch Forum
Topic: which wildcard can be used in this case??
Replies: 13
Views: 4392

which wildcard can be used in this case??

Hi all, I have a if statement as below: if exist "C:\auto_pkg_build\Sources\Source_pkg\%opkg%\%optn%\Factory Download\TETRA\TELIUM3\%VAR14%\Schemes to Sign_for_%VAR001%.doc" ( ....... ) Now the problem is that sometimes the format of this "Schemes to Sign_for_%VAR001%.doc" vary depend upon the devel...