0

我需要一个必须将最新的“.csv”文件导入mysql的shell脚本......

我的情况是--->我需要将最新的“.csv”文件从linux导入到windows mysql,即我的“.csv”文件将存储在linux PC的路径中,导入需要在windows中完成。我将不胜感激迅速的反应。

4

1 回答 1

0

外壳脚本确定:

step 1: sort the csv file by reverse date
        ls --time-style=full-iso -l | grep -E "*.csv" | sort -k5 -k6 -r
step 2: the first file is the latest file
step 3: there should have some tool to import csv file to mysql

windows 或 linux 都不是问题,这就是为什么你也可以从 linux 访问 windows 的 mysql 的原因。只需连接 ip:port 地址。然后做任何你想做的事

于 2013-10-30T05:22:17.073 回答