Remove columns from a CSV using CMD/Batch
I currently have a CSV I download from a vendor which has data in it I do not require before importing it into our system.
I need to removed some columns from the CSV using a batch file as we are on citrix we have not got powershell as an option.
There are no column headers and below is what the CSV looks like:
"9826XXXXXXXXXX217","60007834 "," 10.00","D","22/11/2018"
"9826XXXXXXXXXX324","60008504 "," 12.00","D","22/11/2018"
"9826XXXXXXXXXX414","60010605 "," 12.00","D","22/11/2018"
"9826XXXXXXXXXX013","60011385 "," 12.00","D","22/11/2018"
I need the output to be 2nd, 3rd, 5th column.
"60007834 "," 10.00","22/11/2018"
"60008504 "," 12.00","22/11/2018"
"60010605 "," 12.00","22/11/2018"
"60011385 "," 12.00","22/11/2018"
csv batch-file cmd
add a comment |
I currently have a CSV I download from a vendor which has data in it I do not require before importing it into our system.
I need to removed some columns from the CSV using a batch file as we are on citrix we have not got powershell as an option.
There are no column headers and below is what the CSV looks like:
"9826XXXXXXXXXX217","60007834 "," 10.00","D","22/11/2018"
"9826XXXXXXXXXX324","60008504 "," 12.00","D","22/11/2018"
"9826XXXXXXXXXX414","60010605 "," 12.00","D","22/11/2018"
"9826XXXXXXXXXX013","60011385 "," 12.00","D","22/11/2018"
I need the output to be 2nd, 3rd, 5th column.
"60007834 "," 10.00","22/11/2018"
"60008504 "," 12.00","22/11/2018"
"60010605 "," 12.00","22/11/2018"
"60011385 "," 12.00","22/11/2018"
csv batch-file cmd
1
for more complex csv manipulation with batch files you can take a look at this
– npocmaka
Nov 23 '18 at 9:52
What have you tried, where are you stuck? Please share your efforts!
– aschipfl
Nov 23 '18 at 10:15
@Echo off For %%F in (.txt) do ( (for /f "delims=" %%A in (%%F) do Call :Split %%A ) > "C:Run Folder%%~nF_New.txt" ) goto :Eof :Split if "%~2"=="" goto :eof Echo(%2,%3,%5 move ".txt" "C:Archive" >nul The above is what I ended with which takes columns 2,3,5 and pushes it to an output file which mirrors the old file name with "_New" and it removes the blank line at the end of the file.
– ryall579
Nov 28 '18 at 14:40
add a comment |
I currently have a CSV I download from a vendor which has data in it I do not require before importing it into our system.
I need to removed some columns from the CSV using a batch file as we are on citrix we have not got powershell as an option.
There are no column headers and below is what the CSV looks like:
"9826XXXXXXXXXX217","60007834 "," 10.00","D","22/11/2018"
"9826XXXXXXXXXX324","60008504 "," 12.00","D","22/11/2018"
"9826XXXXXXXXXX414","60010605 "," 12.00","D","22/11/2018"
"9826XXXXXXXXXX013","60011385 "," 12.00","D","22/11/2018"
I need the output to be 2nd, 3rd, 5th column.
"60007834 "," 10.00","22/11/2018"
"60008504 "," 12.00","22/11/2018"
"60010605 "," 12.00","22/11/2018"
"60011385 "," 12.00","22/11/2018"
csv batch-file cmd
I currently have a CSV I download from a vendor which has data in it I do not require before importing it into our system.
I need to removed some columns from the CSV using a batch file as we are on citrix we have not got powershell as an option.
There are no column headers and below is what the CSV looks like:
"9826XXXXXXXXXX217","60007834 "," 10.00","D","22/11/2018"
"9826XXXXXXXXXX324","60008504 "," 12.00","D","22/11/2018"
"9826XXXXXXXXXX414","60010605 "," 12.00","D","22/11/2018"
"9826XXXXXXXXXX013","60011385 "," 12.00","D","22/11/2018"
I need the output to be 2nd, 3rd, 5th column.
"60007834 "," 10.00","22/11/2018"
"60008504 "," 12.00","22/11/2018"
"60010605 "," 12.00","22/11/2018"
"60011385 "," 12.00","22/11/2018"
csv batch-file cmd
csv batch-file cmd
asked Nov 23 '18 at 9:37
ryall579ryall579
205
205
1
for more complex csv manipulation with batch files you can take a look at this
– npocmaka
Nov 23 '18 at 9:52
What have you tried, where are you stuck? Please share your efforts!
– aschipfl
Nov 23 '18 at 10:15
@Echo off For %%F in (.txt) do ( (for /f "delims=" %%A in (%%F) do Call :Split %%A ) > "C:Run Folder%%~nF_New.txt" ) goto :Eof :Split if "%~2"=="" goto :eof Echo(%2,%3,%5 move ".txt" "C:Archive" >nul The above is what I ended with which takes columns 2,3,5 and pushes it to an output file which mirrors the old file name with "_New" and it removes the blank line at the end of the file.
– ryall579
Nov 28 '18 at 14:40
add a comment |
1
for more complex csv manipulation with batch files you can take a look at this
– npocmaka
Nov 23 '18 at 9:52
What have you tried, where are you stuck? Please share your efforts!
– aschipfl
Nov 23 '18 at 10:15
@Echo off For %%F in (.txt) do ( (for /f "delims=" %%A in (%%F) do Call :Split %%A ) > "C:Run Folder%%~nF_New.txt" ) goto :Eof :Split if "%~2"=="" goto :eof Echo(%2,%3,%5 move ".txt" "C:Archive" >nul The above is what I ended with which takes columns 2,3,5 and pushes it to an output file which mirrors the old file name with "_New" and it removes the blank line at the end of the file.
– ryall579
Nov 28 '18 at 14:40
1
1
for more complex csv manipulation with batch files you can take a look at this
– npocmaka
Nov 23 '18 at 9:52
for more complex csv manipulation with batch files you can take a look at this
– npocmaka
Nov 23 '18 at 9:52
What have you tried, where are you stuck? Please share your efforts!
– aschipfl
Nov 23 '18 at 10:15
What have you tried, where are you stuck? Please share your efforts!
– aschipfl
Nov 23 '18 at 10:15
@Echo off For %%F in (.txt) do ( (for /f "delims=" %%A in (%%F) do Call :Split %%A ) > "C:Run Folder%%~nF_New.txt" ) goto :Eof :Split if "%~2"=="" goto :eof Echo(%2,%3,%5 move ".txt" "C:Archive" >nul The above is what I ended with which takes columns 2,3,5 and pushes it to an output file which mirrors the old file name with "_New" and it removes the blank line at the end of the file.
– ryall579
Nov 28 '18 at 14:40
@Echo off For %%F in (.txt) do ( (for /f "delims=" %%A in (%%F) do Call :Split %%A ) > "C:Run Folder%%~nF_New.txt" ) goto :Eof :Split if "%~2"=="" goto :eof Echo(%2,%3,%5 move ".txt" "C:Archive" >nul The above is what I ended with which takes columns 2,3,5 and pushes it to an output file which mirrors the old file name with "_New" and it removes the blank line at the end of the file.
– ryall579
Nov 28 '18 at 14:40
add a comment |
2 Answers
2
active
oldest
votes
In case there are possibly commas inside the fields,
use a call to a sub passing the quoted arguments:
:: Q:Test20181123SO_53444017.cmd
@Echo off
(for /f "delims=" %%A in (test.csv) do Call :Split %%A
) > test_New.csv
goto :Eof
:Split
Echo(%2,%3,%5
> type test_New.csv
"60007834 "," 10.00","22/11/2018"
"60008504 "," 12.00","22/11/2018"
"60010605 "," 12.00","22/11/2018"
"60011385 "," 12.00","22/11/2018"
Edit: Variant processing all *.csv files (appending _New
to the name)
:: Q:Test20181123SO_53444017.cmd
@Echo off
For %%F in (*.csv) do (
(for /f "delims=" %%A in (%%F) do Call :Split %%A
) > "X:Path%%~nF_New.csv"
)
goto :Eof
:Split
Echo(%2,%3,%5
Thanks, this works a treat, anyway I could have the file name as a wild character like: (*.csv), when I try do that it returns a blank file
– ryall579
Nov 23 '18 at 10:54
You'll need an outer for loop to enumerate the files. See edit to the answer.
– LotPings
Nov 23 '18 at 11:00
1
just following the label:split
insert anif "%~2"=="" goto :eof
or a similar check on other columns
– LotPings
Nov 28 '18 at 11:58
1
There is only one redirection to change to directly save in the folder you'd like so) > "%~dpnF_New.csv"
-->) > "X:Yourpath%~nF_New.csv"
But this should be a new question and my answer here deserves an upvote ;-)
– LotPings
Nov 28 '18 at 12:29
1
Sorry missed one % sign, see changed answer. How to vote up
– LotPings
Nov 28 '18 at 12:55
|
show 4 more comments
Not too difficult really.
from batch file, assuming file name is test.csv
(for /f "tokens=2,3,5 delims=," %%i in (test.csv) do echo %%i,%%j,%%k) > newcsv.csv
This will simply write values 2,3,5 to the new csv file..
To run it from cmdline instead, simply remove one of each %
(for /f "tokens=2,3,5 delims=," %i in (test.csv) do echo %i,%j,%k) > newcsv.csv
Please note, this assumes the data within your values do not contain ,
if they do, we need to make some changes.
1
much faster:(for ... ...,%%k)>newcsv.csv
(very noticeable with larger files)
– Stephan
Nov 23 '18 at 11:21
Thanks @Stephan , updated.
– Gerhard Barnard
Nov 23 '18 at 11:27
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53444017%2fremove-columns-from-a-csv-using-cmd-batch%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
In case there are possibly commas inside the fields,
use a call to a sub passing the quoted arguments:
:: Q:Test20181123SO_53444017.cmd
@Echo off
(for /f "delims=" %%A in (test.csv) do Call :Split %%A
) > test_New.csv
goto :Eof
:Split
Echo(%2,%3,%5
> type test_New.csv
"60007834 "," 10.00","22/11/2018"
"60008504 "," 12.00","22/11/2018"
"60010605 "," 12.00","22/11/2018"
"60011385 "," 12.00","22/11/2018"
Edit: Variant processing all *.csv files (appending _New
to the name)
:: Q:Test20181123SO_53444017.cmd
@Echo off
For %%F in (*.csv) do (
(for /f "delims=" %%A in (%%F) do Call :Split %%A
) > "X:Path%%~nF_New.csv"
)
goto :Eof
:Split
Echo(%2,%3,%5
Thanks, this works a treat, anyway I could have the file name as a wild character like: (*.csv), when I try do that it returns a blank file
– ryall579
Nov 23 '18 at 10:54
You'll need an outer for loop to enumerate the files. See edit to the answer.
– LotPings
Nov 23 '18 at 11:00
1
just following the label:split
insert anif "%~2"=="" goto :eof
or a similar check on other columns
– LotPings
Nov 28 '18 at 11:58
1
There is only one redirection to change to directly save in the folder you'd like so) > "%~dpnF_New.csv"
-->) > "X:Yourpath%~nF_New.csv"
But this should be a new question and my answer here deserves an upvote ;-)
– LotPings
Nov 28 '18 at 12:29
1
Sorry missed one % sign, see changed answer. How to vote up
– LotPings
Nov 28 '18 at 12:55
|
show 4 more comments
In case there are possibly commas inside the fields,
use a call to a sub passing the quoted arguments:
:: Q:Test20181123SO_53444017.cmd
@Echo off
(for /f "delims=" %%A in (test.csv) do Call :Split %%A
) > test_New.csv
goto :Eof
:Split
Echo(%2,%3,%5
> type test_New.csv
"60007834 "," 10.00","22/11/2018"
"60008504 "," 12.00","22/11/2018"
"60010605 "," 12.00","22/11/2018"
"60011385 "," 12.00","22/11/2018"
Edit: Variant processing all *.csv files (appending _New
to the name)
:: Q:Test20181123SO_53444017.cmd
@Echo off
For %%F in (*.csv) do (
(for /f "delims=" %%A in (%%F) do Call :Split %%A
) > "X:Path%%~nF_New.csv"
)
goto :Eof
:Split
Echo(%2,%3,%5
Thanks, this works a treat, anyway I could have the file name as a wild character like: (*.csv), when I try do that it returns a blank file
– ryall579
Nov 23 '18 at 10:54
You'll need an outer for loop to enumerate the files. See edit to the answer.
– LotPings
Nov 23 '18 at 11:00
1
just following the label:split
insert anif "%~2"=="" goto :eof
or a similar check on other columns
– LotPings
Nov 28 '18 at 11:58
1
There is only one redirection to change to directly save in the folder you'd like so) > "%~dpnF_New.csv"
-->) > "X:Yourpath%~nF_New.csv"
But this should be a new question and my answer here deserves an upvote ;-)
– LotPings
Nov 28 '18 at 12:29
1
Sorry missed one % sign, see changed answer. How to vote up
– LotPings
Nov 28 '18 at 12:55
|
show 4 more comments
In case there are possibly commas inside the fields,
use a call to a sub passing the quoted arguments:
:: Q:Test20181123SO_53444017.cmd
@Echo off
(for /f "delims=" %%A in (test.csv) do Call :Split %%A
) > test_New.csv
goto :Eof
:Split
Echo(%2,%3,%5
> type test_New.csv
"60007834 "," 10.00","22/11/2018"
"60008504 "," 12.00","22/11/2018"
"60010605 "," 12.00","22/11/2018"
"60011385 "," 12.00","22/11/2018"
Edit: Variant processing all *.csv files (appending _New
to the name)
:: Q:Test20181123SO_53444017.cmd
@Echo off
For %%F in (*.csv) do (
(for /f "delims=" %%A in (%%F) do Call :Split %%A
) > "X:Path%%~nF_New.csv"
)
goto :Eof
:Split
Echo(%2,%3,%5
In case there are possibly commas inside the fields,
use a call to a sub passing the quoted arguments:
:: Q:Test20181123SO_53444017.cmd
@Echo off
(for /f "delims=" %%A in (test.csv) do Call :Split %%A
) > test_New.csv
goto :Eof
:Split
Echo(%2,%3,%5
> type test_New.csv
"60007834 "," 10.00","22/11/2018"
"60008504 "," 12.00","22/11/2018"
"60010605 "," 12.00","22/11/2018"
"60011385 "," 12.00","22/11/2018"
Edit: Variant processing all *.csv files (appending _New
to the name)
:: Q:Test20181123SO_53444017.cmd
@Echo off
For %%F in (*.csv) do (
(for /f "delims=" %%A in (%%F) do Call :Split %%A
) > "X:Path%%~nF_New.csv"
)
goto :Eof
:Split
Echo(%2,%3,%5
edited Nov 28 '18 at 12:53
answered Nov 23 '18 at 10:40
LotPingsLotPings
19k61532
19k61532
Thanks, this works a treat, anyway I could have the file name as a wild character like: (*.csv), when I try do that it returns a blank file
– ryall579
Nov 23 '18 at 10:54
You'll need an outer for loop to enumerate the files. See edit to the answer.
– LotPings
Nov 23 '18 at 11:00
1
just following the label:split
insert anif "%~2"=="" goto :eof
or a similar check on other columns
– LotPings
Nov 28 '18 at 11:58
1
There is only one redirection to change to directly save in the folder you'd like so) > "%~dpnF_New.csv"
-->) > "X:Yourpath%~nF_New.csv"
But this should be a new question and my answer here deserves an upvote ;-)
– LotPings
Nov 28 '18 at 12:29
1
Sorry missed one % sign, see changed answer. How to vote up
– LotPings
Nov 28 '18 at 12:55
|
show 4 more comments
Thanks, this works a treat, anyway I could have the file name as a wild character like: (*.csv), when I try do that it returns a blank file
– ryall579
Nov 23 '18 at 10:54
You'll need an outer for loop to enumerate the files. See edit to the answer.
– LotPings
Nov 23 '18 at 11:00
1
just following the label:split
insert anif "%~2"=="" goto :eof
or a similar check on other columns
– LotPings
Nov 28 '18 at 11:58
1
There is only one redirection to change to directly save in the folder you'd like so) > "%~dpnF_New.csv"
-->) > "X:Yourpath%~nF_New.csv"
But this should be a new question and my answer here deserves an upvote ;-)
– LotPings
Nov 28 '18 at 12:29
1
Sorry missed one % sign, see changed answer. How to vote up
– LotPings
Nov 28 '18 at 12:55
Thanks, this works a treat, anyway I could have the file name as a wild character like: (*.csv), when I try do that it returns a blank file
– ryall579
Nov 23 '18 at 10:54
Thanks, this works a treat, anyway I could have the file name as a wild character like: (*.csv), when I try do that it returns a blank file
– ryall579
Nov 23 '18 at 10:54
You'll need an outer for loop to enumerate the files. See edit to the answer.
– LotPings
Nov 23 '18 at 11:00
You'll need an outer for loop to enumerate the files. See edit to the answer.
– LotPings
Nov 23 '18 at 11:00
1
1
just following the label
:split
insert an if "%~2"=="" goto :eof
or a similar check on other columns– LotPings
Nov 28 '18 at 11:58
just following the label
:split
insert an if "%~2"=="" goto :eof
or a similar check on other columns– LotPings
Nov 28 '18 at 11:58
1
1
There is only one redirection to change to directly save in the folder you'd like so
) > "%~dpnF_New.csv"
--> ) > "X:Yourpath%~nF_New.csv"
But this should be a new question and my answer here deserves an upvote ;-)– LotPings
Nov 28 '18 at 12:29
There is only one redirection to change to directly save in the folder you'd like so
) > "%~dpnF_New.csv"
--> ) > "X:Yourpath%~nF_New.csv"
But this should be a new question and my answer here deserves an upvote ;-)– LotPings
Nov 28 '18 at 12:29
1
1
Sorry missed one % sign, see changed answer. How to vote up
– LotPings
Nov 28 '18 at 12:55
Sorry missed one % sign, see changed answer. How to vote up
– LotPings
Nov 28 '18 at 12:55
|
show 4 more comments
Not too difficult really.
from batch file, assuming file name is test.csv
(for /f "tokens=2,3,5 delims=," %%i in (test.csv) do echo %%i,%%j,%%k) > newcsv.csv
This will simply write values 2,3,5 to the new csv file..
To run it from cmdline instead, simply remove one of each %
(for /f "tokens=2,3,5 delims=," %i in (test.csv) do echo %i,%j,%k) > newcsv.csv
Please note, this assumes the data within your values do not contain ,
if they do, we need to make some changes.
1
much faster:(for ... ...,%%k)>newcsv.csv
(very noticeable with larger files)
– Stephan
Nov 23 '18 at 11:21
Thanks @Stephan , updated.
– Gerhard Barnard
Nov 23 '18 at 11:27
add a comment |
Not too difficult really.
from batch file, assuming file name is test.csv
(for /f "tokens=2,3,5 delims=," %%i in (test.csv) do echo %%i,%%j,%%k) > newcsv.csv
This will simply write values 2,3,5 to the new csv file..
To run it from cmdline instead, simply remove one of each %
(for /f "tokens=2,3,5 delims=," %i in (test.csv) do echo %i,%j,%k) > newcsv.csv
Please note, this assumes the data within your values do not contain ,
if they do, we need to make some changes.
1
much faster:(for ... ...,%%k)>newcsv.csv
(very noticeable with larger files)
– Stephan
Nov 23 '18 at 11:21
Thanks @Stephan , updated.
– Gerhard Barnard
Nov 23 '18 at 11:27
add a comment |
Not too difficult really.
from batch file, assuming file name is test.csv
(for /f "tokens=2,3,5 delims=," %%i in (test.csv) do echo %%i,%%j,%%k) > newcsv.csv
This will simply write values 2,3,5 to the new csv file..
To run it from cmdline instead, simply remove one of each %
(for /f "tokens=2,3,5 delims=," %i in (test.csv) do echo %i,%j,%k) > newcsv.csv
Please note, this assumes the data within your values do not contain ,
if they do, we need to make some changes.
Not too difficult really.
from batch file, assuming file name is test.csv
(for /f "tokens=2,3,5 delims=," %%i in (test.csv) do echo %%i,%%j,%%k) > newcsv.csv
This will simply write values 2,3,5 to the new csv file..
To run it from cmdline instead, simply remove one of each %
(for /f "tokens=2,3,5 delims=," %i in (test.csv) do echo %i,%j,%k) > newcsv.csv
Please note, this assumes the data within your values do not contain ,
if they do, we need to make some changes.
edited Nov 23 '18 at 11:27
answered Nov 23 '18 at 9:48
Gerhard BarnardGerhard Barnard
7,85131232
7,85131232
1
much faster:(for ... ...,%%k)>newcsv.csv
(very noticeable with larger files)
– Stephan
Nov 23 '18 at 11:21
Thanks @Stephan , updated.
– Gerhard Barnard
Nov 23 '18 at 11:27
add a comment |
1
much faster:(for ... ...,%%k)>newcsv.csv
(very noticeable with larger files)
– Stephan
Nov 23 '18 at 11:21
Thanks @Stephan , updated.
– Gerhard Barnard
Nov 23 '18 at 11:27
1
1
much faster:
(for ... ...,%%k)>newcsv.csv
(very noticeable with larger files)– Stephan
Nov 23 '18 at 11:21
much faster:
(for ... ...,%%k)>newcsv.csv
(very noticeable with larger files)– Stephan
Nov 23 '18 at 11:21
Thanks @Stephan , updated.
– Gerhard Barnard
Nov 23 '18 at 11:27
Thanks @Stephan , updated.
– Gerhard Barnard
Nov 23 '18 at 11:27
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53444017%2fremove-columns-from-a-csv-using-cmd-batch%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
for more complex csv manipulation with batch files you can take a look at this
– npocmaka
Nov 23 '18 at 9:52
What have you tried, where are you stuck? Please share your efforts!
– aschipfl
Nov 23 '18 at 10:15
@Echo off For %%F in (.txt) do ( (for /f "delims=" %%A in (%%F) do Call :Split %%A ) > "C:Run Folder%%~nF_New.txt" ) goto :Eof :Split if "%~2"=="" goto :eof Echo(%2,%3,%5 move ".txt" "C:Archive" >nul The above is what I ended with which takes columns 2,3,5 and pushes it to an output file which mirrors the old file name with "_New" and it removes the blank line at the end of the file.
– ryall579
Nov 28 '18 at 14:40