i've got a csv file & i'm just tryign to automate the process of moving a few columns around inside it (it's a product pricelist i get from supplier, and i shift the columns to put it in right order for our database)
so i asked a few people and one guy introduced me to FOR /f & cmd file
so far i have reached this solution:
@echo off
::move column5 to column1
for /f "tokens=1-10 delims=," %%a in (file.csv) do echo %%c,%%h,%%b,%%f,,%%b,%%g,,%%e,dove >> test-output.txt
this seems to work ok!
but now i have encounter this problem. The delimiter is , but the csv file has some fields with , in them. So problem is yes fields are delimited by , but they are Enclosed by " " double quote. So the cmd must only delimit based on , & where there is surrounding quotes!
so I don't know what to do. I guess you could make delims="," but then how do you hand end of line start of line!
anyone have ideas? Maybe there is another programming language that can do this very quick also?
Google seems to be advertising it enough on different streaming services, I don't watch normal TV as i refuse to pay for a Tv licence. (UK)
i have disabled it as much as I can on my phone, I have not changed Google assistant to it and yet still get notifications saying please change to Gemini.
If I don't use google assistant, then what makes them think I want to use Gemini?
As i said, it is disabled or as much as i can.
Exactly. They won't go 100 because current gen consoles are simply too old for any groundbreaking graphics or gaming experience otherwise. They will go with standard (console) price 70 or go with 80 if they really want to go premium. Of course they will have more expensive options too with some useless cosmetics as always.
Question
azuranz
hi there.
i've got a csv file & i'm just tryign to automate the process of moving a few columns around inside it (it's a product pricelist i get from supplier, and i shift the columns to put it in right order for our database)
so i asked a few people and one guy introduced me to FOR /f & cmd file
so far i have reached this solution:
this seems to work ok!
but now i have encounter this problem. The delimiter is , but the csv file has some fields with , in them. So problem is yes fields are delimited by , but they are Enclosed by " " double quote. So the cmd must only delimit based on , & where there is surrounding quotes!
so I don't know what to do. I guess you could make delims="," but then how do you hand end of line start of line!
anyone have ideas? Maybe there is another programming language that can do this very quick also?
Link to comment
https://www.neowin.net/forum/topic/539048-trying-to-make-a-batch-cmd-file-to-shift-a-few-columns-around-in-csv/Share on other sites
2 answers to this question
Recommended Posts