尝试使用JREPL.BAT删除CSV中的列时出错

时间:2016-03-30 09:48:55

标签: csv batch-file

我有以下CSV

Account,Screen Alias,Parent,Account Id,Balance,Currency,Logged In,First  Name,Last Name,Email,Begin Date,Details,Transactions,Change Password
100zz,gdgjk,VIL,32541,0.0000,FUN,NO,dfres,juhfdr,jhgfd@hotmail.com,08/23/15,Details,Transactions,Change Password
1234567890,123kdd,Ziz,34039,650.0000,FUN,NO,amass,aaa,bloty@gmail.com,11/26/15,Details,Transactions,Change Password
12345abc,jackson123,Ziz,34040,0.0000,FUN,NO,aweqwe,uy,hah@gmail.com,11/26/15,Details,Transactions,Change Password
123KDD,123KDD,ZizL,34352,0.0000,FUN,NO,JJ,JJJ,123KDD11@GMAIL.COM,12/09/15,Details,Transactions,Change Password
17man,17man,ayn,30853,890.0000,FUN,NO,yacoub,ahmed,yaqoub@hotmail.com,04/17/15,Details,Transactions,Change Password
1aaaa1,hfjlfj,VIPL,33853,0.0000,FUN,NO,fdshfg,dgfhf,tyduy@hotmail.com,11/17/15,Details,Transactions,Change Password
1qqqq1,hjtdkj,VIPL,33668,0.0000,FUN,NO,jhgddx,hgfljg,hdkhf@hotmail.com,11/06/15,Details,Transactions,Change Password

我正在尝试删除各种列以获取仅包含以下列的csv:

Account, Parent, Balance

摆脱其他人。

我尝试使用带有以下参数的JREPL.BAT删除列Begin Date

C:\jrepl "^((?:.*?\B){15}).*?\Begin Date.*?\Begin Date" "$1" /f "c:\macro_vip\Find Customer.csv" /o -"c:\macro_vip\FindCustomProcess.csv"

哪个不起作用(找不到文件错误...)

有关如何为单个列进行此操作的任何建议,以便我可以在之后重复所有其他列的过程吗?或者以任何方式一次完成所有过程?

1 个答案:

答案 0 :(得分:1)

Account,Parent,Balance
100zz,VIL,0.0000
1234567890,Ziz,650.0000
12345abc,Ziz,0.0000
123KDD,ZizL,0.0000
17man,ayn,890.0000
1aaaa1,VIPL,0.0000
1qqqq1,VIPL,0.0000

输出:

+----+--------------+-----------+----------+
| id |     name     |    lat    |   lng    |
+----+--------------+-----------+----------+
|  1 | Location One | 53.348333 | 0.348333 |
|  2 | Location One | 57.348222 | 0.348222 |
|  3 | Location One | 57.348111 | 0.545454 |
|  4 | Location Two | 55.348554 | 0.555444 |
|  5 | Location Two | 56.348667 | 0.348333 |
|  6 | Location Two | 56.348778 | 0.111111 |
+----+--------------+-----------+----------+