Search found 20 matches

by pawan26sas
25 Jul 2012 00:14
Forum: DOS Batch Forum
Topic: Recursively copy text files and remove duplicate as well
Replies: 35
Views: 18398

Re: Recursively copy text files and remove duplicate as well

Hi Thanks to all of you ... . The timestamp issue has got resolved now.. but what is this 8192 byte limit ..?? As this script is using echo and then redirection to merge these all csv to one single csv in one shot, recursively. And I also got the concept of copy but which one would be faster from pe...
by pawan26sas
24 Jul 2012 06:44
Forum: DOS Batch Forum
Topic: Recursively copy text files and remove duplicate as well
Replies: 35
Views: 18398

Re: Recursively copy text files and remove duplicate as well

Yes it is redirecting - echo %%c >> "%%~na""_AutoMerge_"%Timestamp%".297" but this filename - "%%~na""_AutoMerge_"%Timestamp%".297" is not containing Timestamp .. output :- somefilename_AutoMerge_.297 Desired O/P :- somefilename_AutoMerge_<...
by pawan26sas
24 Jul 2012 06:30
Forum: DOS Batch Forum
Topic: Recursively copy text files and remove duplicate as well
Replies: 35
Views: 18398

Re: Recursively copy text files and remove duplicate as well

I have done with the script, but now there is only one problem -- please help me. @echo off cls For %%f in (.) do set "folder=%%~nf" :: Delete All Old Merged csv files, if there. cd .. del "*_AutoMerge_*.csv" /S /F /Q cd %folder% :: 1st it set the current dir to a variable to use...
by pawan26sas
24 Jul 2012 04:32
Forum: DOS Batch Forum
Topic: Recursively copy text files and remove duplicate as well
Replies: 35
Views: 18398

Re: Recursively copy text files and remove duplicate as well

Now the modified is like -- It is fulfilling my 98% requirement.... @echo off cls For %%a in (.) do set "folder=%%~na" :: Delete All Old Merged csv files, if there. For /R %%a in (.) Do ( set "directory=%~dp0" pushd %%a For /f "tokens=*" %%b in ('dir /S /B /A:-D *_AutoM...
by pawan26sas
24 Jul 2012 04:05
Forum: DOS Batch Forum
Topic: Recursively copy text files and remove duplicate as well
Replies: 35
Views: 18398

Re: Recursively copy text files and remove duplicate as well

Can anyone please help me in this below code ........ @echo off cls :: Delete All Old Merged csv files, if there. For /R %%a in (.) Do ( set "directory=%~dp0" pushd %%a For /f "tokens=*" %%b in ('dir /S /B /A:-D *_AutoMerge.csv') do ( For /f "tokens=*" %%c in ('type &qu...
by pawan26sas
24 Jul 2012 02:22
Forum: DOS Batch Forum
Topic: Recursively copy text files and remove duplicate as well
Replies: 35
Views: 18398

Re: Recursively copy text files and remove duplicate as well

Hi abc0502, I need little bit change in this above working script ---- 1.) File should be save at one level up in the folder hierarchy but the file name will remain same. 2.) File_name like -- <Folder_name>_AutoMerge_<Timestamp in DDMMYYY>.csv -- (Little bit modification in file-name also needed) ex...
by pawan26sas
24 Jul 2012 00:08
Forum: DOS Batch Forum
Topic: How to replace SPACE from Directory/Sub-Directories
Replies: 8
Views: 8601

Re: How to replace SPACE from Directory/Sub-Directories

Hi "Squashman" and "Ed Dyreen"

Thanks to you both for your quick reply.

These both the script is working fine for me.

Again, Thanks a Lot....
by pawan26sas
23 Jul 2012 23:38
Forum: DOS Batch Forum
Topic: Recursively copy text files and remove duplicate as well
Replies: 35
Views: 18398

Re: Recursively copy text files and remove duplicate as well

Hi abc0502,


Thanks a Lot. Yes, this script is working fine for me with all my aspect. Thanks a lot again for your valuable time.


Thanks and Regards,
Pawan Sarswat
by pawan26sas
23 Jul 2012 07:13
Forum: DOS Batch Forum
Topic: How to replace SPACE from Directory/Sub-Directories
Replies: 8
Views: 8601

Re: How to replace SPACE from Directory/Sub-Directories

Nope ... Its not working... neither - @ECHO OFF SETLOCAL EnableDelayedExpansion FOR /f "tokens=*" %%a IN ('DIR /s /b /ad') DO ( SET Var=%%a SET Var=!Var: =_! REN "%%a" "!Var!" ) nor @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION for /f "delims=" %%A in ('dir /b /s ...
by pawan26sas
23 Jul 2012 06:28
Forum: DOS Batch Forum
Topic: How to replace SPACE from Directory/Sub-Directories
Replies: 8
Views: 8601

Re: How to replace SPACE from Directory/Sub-Directories

As you said - I removed - ~n -- like this...

@ECHO OFF
SETLOCAL EnableDelayedExpansion

FOR /f "tokens=*" %%a IN ('DIR /s /b /ad') DO (
SET Var=%%a
SET Var=!Var:_= !
REN "%%a" "!Var!"
)



but now it is giving me an error -- the syntax of command is incorrect.
by pawan26sas
23 Jul 2012 04:30
Forum: DOS Batch Forum
Topic: How to replace SPACE from Directory/Sub-Directories
Replies: 8
Views: 8601

Re: How to replace SPACE from Directory/Sub-Directories

Please have a look and reply --


I am unknown to it.. .I have searched on google as well ... but not able to find a solution .. :(
by pawan26sas
23 Jul 2012 03:55
Forum: DOS Batch Forum
Topic: How to replace SPACE from Directory/Sub-Directories
Replies: 8
Views: 8601

How to replace SPACE from Directory/Sub-Directories

I am very New to Batch Script -- --------------------------------------------------------------------------------------------------------------------- As this below script is working fine for file-names -- (replacing space with underscore; recursively) @ECHO OFF SETLOCAL EnableDelayedExpansion FOR /...
by pawan26sas
23 Jul 2012 03:36
Forum: DOS Batch Forum
Topic: Recursively copy text files and remove duplicate as well
Replies: 35
Views: 18398

Re: Recursively copy text files and remove duplicate as well

That I have done with batch script ... but now my first and formost concern is - I need to remove spaces from the directory name. this script is working for this -- but only for current directory but not for recursively sub-directories. @ECHO OFF SETLOCAL EnableDelayedExpansion FOR /f "tokens=*...
by pawan26sas
23 Jul 2012 03:13
Forum: DOS Batch Forum
Topic: Recursively copy text files and remove duplicate as well
Replies: 35
Views: 18398

Re: Recursively copy text files and remove duplicate as well

Is there anyone -- who can please help me in this ....
by pawan26sas
18 Jul 2012 03:24
Forum: DOS Batch Forum
Topic: Recursively copy text files and remove duplicate as well
Replies: 35
Views: 18398

Re: Recursively copy text files and remove duplicate as well

Thank you very much -- @ Foxidrive ___________________________________________________________ @echo off :: This will copy into single final file at extreme parent level. For /F %%a in ('dir /S /B /A:-D *.txt') do ( for /f "tokens=*" %%b in (%%a) do echo %%b >> pawan.txt ) ________________...