Search found 6 matches

by catalyph
13 Jun 2018 09:57
Forum: DOS Batch Forum
Topic: Copy csv with new column that adds 2 existing columns
Replies: 8
Views: 6015

Re: Copy csv with new column that adds 2 existing columns

@catalyph, I have a question for you. In the new line that you added: FOR /F "delims=" %%I IN ('DIR "ProData\*.csv" /B /O:D') DO SET NewestFile=%%I ^ ^ ... you inserted apostrophes (marked above with carets) to enclose the whole DIR command. Why? Without those, the .bat does not work it seems.
by catalyph
13 Jun 2018 07:57
Forum: DOS Batch Forum
Topic: Copy csv with new column that adds 2 existing columns
Replies: 8
Views: 6015

Re: Copy csv with new column that adds 2 existing columns

@catalyph, I have a question for you. In the new line that you added: FOR /F "delims=" %%I IN ('DIR "ProData\*.csv" /B /O:D') DO SET NewestFile=%%I ^ ^ ... you inserted apostrophes (marked above with carets) to enclose the whole DIR command. Why? I'm not the creator of the command, I have little kn...
by catalyph
12 Jun 2018 13:25
Forum: DOS Batch Forum
Topic: Copy csv with new column that adds 2 existing columns
Replies: 8
Views: 6015

Re: Copt csv with new column that adds 2 existing columns

Squashman wrote:
12 Jun 2018 09:27
Your totals are larger than a 32 bit Integer which is a limitation of the SET /A command which does expression evaluation. Regardless of that, your task can still be accomplished, just in a different way.

How so ? Still using bat?
by catalyph
12 Jun 2018 12:30
Forum: DOS Batch Forum
Topic: Copy csv with new column that adds 2 existing columns
Replies: 8
Views: 6015

Re: Copt csv with new column that adds 2 existing columns

Im having trouble implementing this into my batch file. I have a line that sets the latest csv file to the var NewestFile, when I use Newest file as the file it des not work @echo off setlocal EnableDelayedExpansion FOR /F "delims=" %%I IN ('DIR "ProData\*.csv" /B /O:D') DO SET NewestFile=%%I set "h...
by catalyph
12 Jun 2018 12:01
Forum: DOS Batch Forum
Topic: Copy csv with new column that adds 2 existing columns
Replies: 8
Views: 6015

Re: Copt csv with new column that adds 2 existing columns

OK this worked by itself but not when I place it in my current bat. I have a portion that sets the newest file in the directory to the variable %NewestFile% @echo off setlocal EnableDelayedExpansion FOR /F "delims=" %%I IN ('DIR "ProData\*.csv" /B /O:D') DO SET NewestFile=%%I set "header=" (for /F "...
by catalyph
12 Jun 2018 09:21
Forum: DOS Batch Forum
Topic: Copy csv with new column that adds 2 existing columns
Replies: 8
Views: 6015

Copy csv with new column that adds 2 existing columns

I have a .csv file Prod,Name,Datetime,Type,MemFree,MemAvailable,MemTotal PRDAAA,HJGYASW,6/11/2018 23:06,WIN,4319264768,4875202560,8006983680 PRDBBB,UYBCLAS,6/11/2018 23:11,WIN,4313509888,4870922240,8006983680 I need to move this csv to a new location and add 2 new columns with new headers of "MemUse...