ShadowThief wrote:Code: Select all
@echo off
for /F "tokens=1-3* delims=," %%A in (data.csv) do (
>>output.csv echo %%A,%%B,%%C,"New Addition",%%D
)
Hi All,
The above code is not working for my below file format:
My Input file is too long:
Code: Select all
a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aaa,abb,acc,add,aee
a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aaq,abx,acy,adz,aee
a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aap,abq,acg,adh,aen
So if I try with this code, then it's not working for me as the token I can use is from " a to z " but my input file is having more than 26 columns so I tried something like this below. But it didn't work. Please advice what to do.
Code: Select all
@echo off
for /F "tokens=1-31* delims=," %%A in (data.csv) do (
>>output.csv echo %%AA,%%B,%%AC,%%D
)
My desired output:
But I'm getting output as:
Please suggest the change required in the code.
Note: For all the files having less than 26 values in a row is working fine as I'm using the same code and tokens from a-z.