Home > OS >  I would like to ask a bat take value of certain columns in the CSV
I would like to ask a bat take value of certain columns in the CSV

Time:10-09

I would like to ask a bat in the value of the a few columns in the CSV, but CSV column has 43, take to 38, more than 26 qualified,,
User ID, provinces, gender, age, date of registration, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33
112260, Inner Mongolia, male, 22201 1/2/6, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2 and q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, aa2, ab2, ac2, ad2, ae2, af2, hf-solvated ag2, ah2, ai2, aj2, ak2, al2

Below is my code, can take out some columns,, but beyond the limits, and find all make uncertain, a lot of data, and exclude o
For/f "delims=" % % a in (' dir/b *. CSV) do (
For/f "tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39 delims=," % % b in (' type "a" % % ') do (
Echo % % b, c % %, % % d, % % e, % % f, % % g, h % %, % % I, % % j, % % k, l, % % % % m, % % n % % o % % p % % q, and % % r, % % s, % % t, % % u, % % v, w, % % % % x, y % %, % % z, "aa" % %, % % 2, % % 3 & gt;> CSV. TXT

)

)
pause

CodePudding user response:

Vba or VBS, to choose the right tools before working

CodePudding user response:

reference 1st floor Runnerchin response:
vba or VBS, work to choose the right tools before


Can't, the company requires the bat file, can be embedded in the existing system,,, if can have a choice, would have completed the

CodePudding user response:

Can use the bat with VBS

CodePudding user response:

reference Runnerchin reply: 3/f
can bat place can use VBS

A system similar to existing EXE program, can add the bat program to enter as a process execution, and VBS words

CodePudding user response:

 @ echo off 
Cscript/e: VBS c: \ Dr. Bs

CodePudding user response:

 echo off 
Start "C: \ test \ aaa. Exe"

CodePudding user response:

reference 5 floor Runnerchin reply:
 @ echo off 
Cscript/e: VBS c: \ Dr. Bs


Bat seemed indeed cattle B, learn something new again
I EXE has been written in c #,, is to lead are not allowed to use,,,

CodePudding user response:

Two parts processing, together again?

CodePudding user response:

Just demonstrate in bat calls VBS or exe, actually use the on-demand option

CodePudding user response:

The
reference zara's reply: the eighth floor
two parts processing, together again?

I put tokens in the for loop 1 to 20, 21 to 40 statements during a cycle error, directly, and can give a sample? Not familiar with the language of bat

CodePudding user response:

Split, if really not line, just tried to Windows 7 for tokens change will only after treatment to 31, 32 and empty,

CodePudding user response:

11 references, zara's reply:
split, as if did not, just try, Windows 7 for tokens change will only after treatment to 31, 32 and empty,

Other languages do EXE to call, the server also forbidden to add something,,, also can only look to him now, plan submitted, see led
  • Related