Search found 384 matches

by Samir
10 Jul 2014 23:31
Forum: DOS Batch Forum
Topic: Downloading file from server over FTP
Replies: 6
Views: 5568

Re: Downloading file from server over FTP

I haven't tested this, but is it possible to use

Code: Select all

cd abc_20140221_*
within ftp like you can from the command line? If so, this might be of some use.
by Samir
10 Jul 2014 23:29
Forum: DOS Batch Forum
Topic: How to automatically save files with different names?
Replies: 4
Views: 4009

Re: How to automatically save files with different names?

What's really powerful about the batch foxidrive posted is that you can change the line: echo wget %%a --output-document=%%~nxb_%%~nxa to echo start wget %%a --output-document=%%~nxb_%%~nxa and it will launch each download as its own process, downloading everything in parallel. This may be a bit for...
by Samir
10 Jul 2014 23:25
Forum: DOS Batch Forum
Topic: Variable Replacement in a file
Replies: 16
Views: 8097

Re: Variable Replacement in a file

I'm like you where I like to understand code (or at least all the test cases) before I implement or try to use it. I found it worth the time to figure out a 'replace' batch file that suited my purpose. Then, to avoid calling external batches, I simply incorporated the code into my own batch. It's si...
by Samir
10 Jul 2014 23:17
Forum: DOS Batch Forum
Topic: Stop batch from exit
Replies: 3
Views: 2741

Re: Stop batch from exit

It was a bigger problem. I got the window to stop closing using pause like normal. Thank you for the assistance! 8)
by Samir
08 Jul 2014 12:22
Forum: DOS Batch Forum
Topic: rename a file in a batch script
Replies: 19
Views: 10515

Re: new script

Post your rename scripts and some examples.
by Samir
08 Jul 2014 11:55
Forum: DOS Batch Forum
Topic: Stop batch from exit
Replies: 3
Views: 2741

Stop batch from exit

I hate to bump an older thread, but I think I'm facing the same problem the OP had with the dos window automatically 'exiting'. The batch file is just a single line with a for loop on it. I tried adding PAUSE after the for loop thinking that would stop the window from exiting, but it didn't. I tried...
by Samir
08 Jul 2014 11:47
Forum: DOS Batch Forum
Topic: Rename xx to xx-1 Via Single Command Line
Replies: 10
Views: 6441

Re: Rename xx to xx-1 Via Single Command Line

Not sure why you would want to type this at the cmd line but go nuts. cmd /v:on /C "for /l %i in (101 1 110) do (set /a "n1=%i, n2=%i-1" & ECHO ren !n1:~-2! !n2:~-2!)" So I don't have to have a batch file just for the rename. So you are literally going to type this whole lin...
by Samir
08 Jul 2014 11:41
Forum: DOS Batch Forum
Topic: Safely parse nearly any CSV with parseCSV.bat v1.3
Replies: 10
Views: 26024

Re: Safely parse nearly any CSV with parseCSV.bat

Very nice. I need to remember this for an upcoming batch where I'll need to a parse by tabs...
by Samir
19 Jun 2014 17:41
Forum: DOS Batch Forum
Topic: Delete a set of files on a particular system date
Replies: 7
Views: 4968

Re: Delete a set of files on a particular system date

Well I will disagree with you all day and all night on that point. I do Automation for a Living. We have over 600 automated tasks that run every day. I would say about 100 of these are triggered by Task Scheduler every day. All these tasks are spread out over 3 application servers. Hasn't failed us...
by Samir
19 Jun 2014 17:37
Forum: DOS Batch Forum
Topic: Rename xx to xx-1 Via Single Command Line
Replies: 10
Views: 6441

Re: Rename xx to xx-1 Via Single Command Line

Squashman wrote:Not sure why you would want to type this at the cmd line but go nuts.

Code: Select all

cmd /v:on /C "for /l %i in (101 1 110) do (set /a "n1=%i, n2=%i-1" & ECHO ren !n1:~-2! !n2:~-2!)"
So I don't have to have a batch file just for the rename. :mrgreen:
by Samir
19 Jun 2014 17:35
Forum: DOS Batch Forum
Topic: Sorting a 'Column' in a CSV or tab-delimited File
Replies: 18
Views: 15731

Re: Sorting a 'Column' in a CSV or tab-delimited File

Wonderful answers gentlemen! Thank you so much!

I'll be using this to parse a csv into another format. 8)
by Samir
17 Jun 2014 08:52
Forum: DOS Batch Forum
Topic: Sorting a 'Column' in a CSV or tab-delimited File
Replies: 18
Views: 15731

Sorting a 'Column' in a CSV or tab-delimited File

I somehow remember some code for this on here, but I've searched and searched to no avail. Imaging a txt file with 4 columns of data delimited by tab or comma. Each column has different length of strings. Because each column's stringlength is different, you can't simply use sort /+n to sort the file...
by Samir
17 Jun 2014 08:49
Forum: DOS Batch Forum
Topic: replacing tab/space with comma in a file via batch
Replies: 9
Views: 20345

Re: replacing tab/space with comma in a file via batch

Thank you foxidrive. 8) I knew there was a simple answer, but couldn't find it.
by Samir
17 Jun 2014 08:25
Forum: DOS Batch Forum
Topic: Convert .xls and .csv to tab-delimited .txt
Replies: 6
Views: 13904

Re: Convert .xls and .csv to tab-delimited .txt

I hate to bump an older thread, but is there an answer to this? I'm wondering the exact same thing.
by Samir
17 Jun 2014 08:25
Forum: DOS Batch Forum
Topic: replacing tab/space with comma in a file via batch
Replies: 9
Views: 20345

Re: replacing tab/space with comma in a file via batch

I hate to bump an older thread, but is there an answer to this? I'm wondering the exact same thing.