Search found 198 matches

by goodywp
22 Nov 2018 05:38
Forum: DOS Batch Forum
Topic: How to cut some blocks off the entire file then save into separated file
Replies: 23
Views: 5944

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

cutoff where ? at a specified byte position or based upon the occurrence of a string ? based upon the occurrence of a string. cut off all the strings before this line, in other words to save the strings starting from below line ;---- NAR signed binaries to the end. but also need to cut off unwanted...
by goodywp
21 Nov 2018 16:33
Forum: DOS Batch Forum
Topic: How to cut some blocks off the entire file then save into separated file
Replies: 23
Views: 5944

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

I have a task to cut off some blocks of entire file (Load_all.M83) then save it into a separated file (Load_NAR.M83). Here is the outline of this entire file structure, it is a catalog file ;---- Groupe signed binaries -epackage ;---- Component: EasyPath to Cless ;---- Catalog: Entry Point 0200000.M...
by goodywp
23 Aug 2018 12:28
Forum: DOS Batch Forum
Topic: Deleting specific lines from a text file
Replies: 6
Views: 2596

Re: Deleting specific lines from a text file

aGerman wrote:
23 Aug 2018 08:27
Are you serious that you really need help to remove the /x from the command line? There are two possibilities, either use the DEL or the backspace key.

Steffen
I would be more than happy to see the two possibilities... :D
Thanks
by goodywp
23 Aug 2018 08:14
Forum: DOS Batch Forum
Topic: Delete lines based upon string or file
Replies: 9
Views: 2898

Re: Delete lines based upon string or file

ups my mistake. I forgot that filenames should be used in the for /f loop with the usebackQ option. this damn cellphone. I tired the below code as you suggested, please correct me if I am wrong and still not working >tempFilterFile ( @ for /f "usebackq tokens=*" %%i in ("filterFile") do @ ( for %%j...
by goodywp
23 Aug 2018 06:15
Forum: DOS Batch Forum
Topic: Deleting specific lines from a text file
Replies: 6
Views: 2596

Re: Deleting specific lines from a text file

My apologize for the duplicated questions! Sorry......!
Could you help me to remove it.
Thanks
by goodywp
22 Aug 2018 15:16
Forum: DOS Batch Forum
Topic: Deleting specific lines from a text file
Replies: 6
Views: 2596

Deleting specific lines from a text file

Hi all, I had two text files one is whole and the other is part.txt Here is the content of whole.txt From \T501-08815-0103\Application_Signing\Signed_Schemes\QA_Infra-SL_0102_Signed_T3\ .500006011000.S3S .500007011000.S3S .500008011000.S3S .500009011000.S3S .500010011000.S3S .500011011000.S3S .50001...
by goodywp
22 Aug 2018 09:02
Forum: DOS Batch Forum
Topic: copy files from uncertain subfolders into another location
Replies: 9
Views: 2894

Re: copy files from uncertain subfolders into another location

FOR /F - Loop through items in a text file Not in your case. And you didn't answer my question of what you'll find in %%G. (hint: ECHO %%G helps to figure it out) FWIW FOR /F processes streams. That can be file streams besides of the standard output stream or string streams. In your example the sta...
by goodywp
09 Aug 2018 06:51
Forum: DOS Batch Forum
Topic: copy files from uncertain subfolders into another location
Replies: 9
Views: 2894

Re: copy files from uncertain subfolders into another location

~ d p n expands C: \bla\ blub .txt to C: \bla\ blub A few more questions to you: 1) Will the file be found if the file extension was stripped from the file name? 2) What is the difference between the content of %%G in the FOR /F loop and the content of %%G in the FOR /R loop? Steffen FOR /F - Loop ...
by goodywp
08 Aug 2018 13:21
Forum: DOS Batch Forum
Topic: copy files from uncertain subfolders into another location
Replies: 9
Views: 2894

Re: copy files from uncertain subfolders into another location

aGerman wrote:
08 Aug 2018 09:26
What do you think are the modifiers ~dpn for?

Steffen
expands %G to a drive letter and path only
tried using %~nxG expands %G to a file name and extension only not working :x
by goodywp
08 Aug 2018 06:13
Forum: DOS Batch Forum
Topic: copy files from uncertain subfolders into another location
Replies: 9
Views: 2894

Re: copy files from uncertain subfolders into another location

Thank you both!!! I tried this as below and works call C:\auto_pkg_build\Scripts\single_comp\srcfg.cmd cd "C:\auto_pkg_build\Sources\Source_schemes\Tetra_Schemes\%VARSRC5%-*\%VARSRC5%" FOR /F "delims=" %%G IN ('dir /b /s *.S3S') DO ( copy %%G C:\auto_pkg_build\Sources\Source_schemes\Single_Replace\%...
by goodywp
07 Aug 2018 08:19
Forum: DOS Batch Forum
Topic: copy files from uncertain subfolders into another location
Replies: 9
Views: 2894

copy files from uncertain subfolders into another location

Hi, I need to copy all files which sit from one subfolder to another location. The issue is that I do not know how many subfolder levels under one known folder (efg) downtwards to this final subfolder, which shall have files with extension .S3S, this final subfolder name can vary depend on different...
by goodywp
26 Jul 2018 07:40
Forum: DOS Batch Forum
Topic: how to output multiple results from loop clause
Replies: 6
Views: 2004

Re: how to output multiple results from loop clause

aGerman wrote:
25 Jul 2018 15:05
Just use the space as delimiter (which is the default) and output everything after the fourth token (which is the colon).

Code: Select all

>"signfile.txt" (for /f "usebackq tokens=4*" %%a in ("need2sign.txt") do echo %%b)
Steffen
Amazing! and good to learn from you case by case.... :)
by goodywp
25 Jul 2018 15:00
Forum: DOS Batch Forum
Topic: how to output multiple results from loop clause
Replies: 6
Views: 2004

Re: how to output multiple results from loop clause

BTW, in another case, I got the string I want as above, but the first character of the string is space, can this first space also be eliminated from above? Certainly it can. But without knowing how the lines look like and what part of them you need I can't give any good advice. Steffen The file loo...
by goodywp
25 Jul 2018 14:31
Forum: DOS Batch Forum
Topic: how to output multiple results from loop clause
Replies: 6
Views: 2004

Re: how to output multiple results from loop clause

You overwrite variable base multiple times in the loop and of course only the last value is left in the variable after the loop ended. What's the reason why you think you need an additional variable? You already have the values in %%b. @echo off >"signfder.txt" (for /f "usebackq tokens=1* delims=\"...
by goodywp
25 Jul 2018 13:38
Forum: DOS Batch Forum
Topic: how to output multiple results from loop clause
Replies: 6
Views: 2004

how to output multiple results from loop clause

Hi This could be easy for you but I am not. I had a file as below Location : TELIUM3\TSA Location : TELIUM3\KIA Location : TELIUM3\TCPXCOM Location : TELIUM3\TCPXCORE Location : TELIUM3\TCPXHMI Location : TELIUM3\TCPXVEGA Location : TELIUM3\E2EE_App Location : TELIUM3\Web Platform Lock Application L...