Search found 189 matches

by goodywp
17 Oct 2019 14:45
Forum: DOS Batch Forum
Topic: Insert new line at certain line works but the lines starting with ; all gone, why?
Replies: 3
Views: 177

Re: Insert new line at certain line works but the lines starting with ; all gone, why?

Thanks Eureka's help! SETLOCAL ENABLEDELAYEDEXPANSION set inputFile=Load_SDK.M71 set outputFile=Load_SDKtest.M71 set _strInsert=9993047045001700_LINGOT_WP_MKP.P3O set _strFind=9993047031002908_WP_WBService.P3P FOR /F "usebackq delims= eol=@" %%A IN ("%inputFile%") DO ( Echo %%A | Find "%_strFind%" &...
by goodywp
17 Oct 2019 13:55
Forum: DOS Batch Forum
Topic: Insert new line at certain line works but the lines starting with ; all gone, why?
Replies: 3
Views: 177

Insert new line at certain line works but the lines starting with ; all gone, why?

Hi I tried to insert a new line at a certain line. It works via below two code pieces but all the lines beginning with ; are all gone, why? any solution? My original file (Load_SDK.M71) looks like this ; ;----------WebPlatForm_2.10.9.B---------------------- 9993047039001700_WP_APPS_BROWSER.P3O 99930...
by goodywp
26 Aug 2019 10:16
Forum: DOS Batch Forum
Topic: Remove or comment out string from second occurrence in a file
Replies: 0
Views: 1136

Remove or comment out string from second occurrence in a file

I have searched and seems not getting a solution. Here is my task. I have a catalog file (text file). In this catalog file, I have some contents like this ; Group 1 -epackage ...... ;Group 2 -epackage ..... ;Group 1 -eimport ... ;Group 2 -eimport This above catalog file needed to be remove or replac...
by goodywp
10 Jul 2019 09:45
Forum: DOS Batch Forum
Topic: Find command did not read temp params anymore
Replies: 3
Views: 2917

Re: Why this temp read params not find anymore

Today, I got another issue which I could think of similar to this original issue set sch_1=T501-08815-0103 find /i "%sch_1%"<all_scheme.txt>>list_sch.txt Here is what I got find: /i: No such file or directory find: T501-08815-0103: No such file or directory The above script works fine in my laptop b...
by goodywp
29 May 2019 07:19
Forum: DOS Batch Forum
Topic: Find command did not read temp params anymore
Replies: 3
Views: 2917

Re: Why this remp read params not find anymore

ShadowThief wrote:
28 May 2019 19:47
BaseMain.cfg (whatever that is) seems to have been deleted
Thanks for your reply! Yes I was thinking that way but checked that the file was there...
by goodywp
28 May 2019 11:08
Forum: DOS Batch Forum
Topic: Find command did not read temp params anymore
Replies: 3
Views: 2917

Find command did not read temp params anymore

Hi all, I just came across this issue, sth. related to system. :: load parameters from BaseMain.cfg find /V ";;" BaseMain.cfg | find "=" > __temp_read_params for /F "tokens=*" %%I in (__temp_read_params) do set %%I del /Q __temp_read_params >Nul Basically, it shall read the params from BaseMain.cfg ...
by goodywp
29 Nov 2018 04:55
Forum: DOS Batch Forum
Topic: How to cut some blocks off the entire file then save into separated file
Replies: 23
Views: 2557

Re: How to cut off some blocks off the entire file then save into separated file

For changeable strings to remove from ED's original scripts, I just modified as below then tested and works fine for me. Just cut off the changeable part of the strings then set as new variable, which will be used in ED's original code. Thanks ED again. @echo off &setlocal enableDelayedExpansion set...
by goodywp
29 Nov 2018 04:49
Forum: DOS Batch Forum
Topic: About call Function with Arguments
Replies: 3
Views: 759

Re: About call Function with Arguments

Squashman wrote:
28 Nov 2018 16:30
When file and folder names have spaces in them, what are you supposed to do?
OOPS again the space forgot to take care of.. My bad..
Should I delete this post, please advise...
Thanks
by goodywp
28 Nov 2018 16:03
Forum: DOS Batch Forum
Topic: About call Function with Arguments
Replies: 3
Views: 759

About call Function with Arguments

I just had a test about call function with arguments @echo off echo.going to execute myDosFunc with different arguments set fdl_1=function1 set fdl_2=function2 set fdl_3=function3 call:myDosFunc %fdl_1% *xt1.txt call:myDosFunc %fdl_2% *xt2.txt call:myDosFunc %fdl_3% *xt3.txt goto:eof ::-------------...
by goodywp
26 Nov 2018 13:56
Forum: DOS Batch Forum
Topic: How to cut some blocks off the entire file then save into separated file
Replies: 23
Views: 2557

Re: How to cut off some blocks off the entire file then save into separated file

Now cross posted on StackOverFlow . Hi, Squashman, Please advise on this... When I continue to ask the same topic related question, you said "Starting to sound like scope creep." In order to avoid this, I would ask the similar question on StackOverFlow… you again gave your comment... Would you plea...
by goodywp
26 Nov 2018 11:14
Forum: DOS Batch Forum
Topic: How to cut some blocks off the entire file then save into separated file
Replies: 23
Views: 2557

Re: How to cut off some blocks off the entire file then save into separated file

You could use findstr which does support regular expressions Echo.Hello There |findstr ".*Th?r?" But you should usually try to avoid findstr because this slows down significantly. With the faster set you can cut off the start of a variable set "$=Hello There" set "$=%$:* =%"%= strip off 'Hello ' =%...
by goodywp
26 Nov 2018 08:56
Forum: DOS Batch Forum
Topic: How to cut some blocks off the entire file then save into separated file
Replies: 23
Views: 2557

Re: How to cut off some blocks off the entire file then save into separated file

Hi ED, Since I had two questions related tho this post, which are as below: 1) The code in this post is working for cutting off the block before certain string in the middle of the text, then also try to remove certain strings in the remaining (keeping) to end. If I want to delete some strings which...
by goodywp
24 Nov 2018 07:47
Forum: DOS Batch Forum
Topic: How to cut some blocks off the entire file then save into separated file
Replies: 23
Views: 2557

Re: How to cut off some blocks off the entire file then save into separated file

@echo off &setlocal enableDelayedExpansion set "$fileIn=Load_all.M72" set "$fileOu=Load_NAR.M72" > "!$fileOu!" type nul for /F %%? in ( '^( find /V /C"" ^< "!$fileIn!" ^) 2^>nul' ) do set "$NumberOfLines=%%?" < "!$fileIn!" ( set /A $at = 0 &for /L %%i in ( 1, 1, !$NumberOfLines! ) do ( set "$=" &se...
by goodywp
24 Nov 2018 05:27
Forum: DOS Batch Forum
Topic: How to cut some blocks off the entire file then save into separated file
Replies: 23
Views: 2557

Re: How to cut off some blocks off the entire file then save into separated file

If I want to remove more lines as below code @echo off &setlocal enableDelayedExpansion set "$fileIn=Load_all.M72" set "$fileOu=Load_NAR.M72" > "!$fileOu!" type nul for /F %%? in ( '^( find /V /C"" ^< "!$fileIn!" ^) 2^>nul' ) do set "$NumberOfLines=%%?" < "!$fileIn!" ( set /A $at = 0 &for /L %%i in ...
by goodywp
23 Nov 2018 16:27
Forum: DOS Batch Forum
Topic: How to cut some blocks off the entire file then save into separated file
Replies: 23
Views: 2557

Re: How to cut off some blocks off the entire file then save into separated file

;---- NAR signed binaries -epackage ;---- Component: Tetra Admin Resources 0001 ;---- Catalog: TA_resources.mxx 8520440000_852044.P3P ;---- Component: Tetra Admin Proxy Lib 0001 ;---- Catalog: TAProxylib_app.mxx 8400000100000000_libTAProxy.P3L ;---- Component: NAR TSA Tetra 0521 ;---- Catalog: 8295...