作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有以下要加载到 Oracle 表的 csv 文件。
cat to_load_pplp.csv
Table PPL_CH_USAGE,178,01/Sep/2017 09:03:30,01/Sep/2017 09:03:30
PPL_INVOICE,22015731,01/Sep/2017 05:30:21,01/Sep/2017 05:30:21
PPL_LIABILITY,2468705,01/Sep/2017 06:56:41,01/Sep/2017 06:56:41
Table MBBSCS_PPL_INVOICE,3768639,01/Sep/2017 07:00:15,01/Sep/2017 07:00:15
Table MBBSCS_PPL_USAGE,1914718,01/Sep/2017 20:02:03,01/Sep/2017 20:02:03
CONTRACT_MSISDN,3785568,01/Sep/2017 04:00:26,01/Sep/2017 04:00:26
Table OCS_OFFER_CONF_2,16838060,01/Sep/2017 09:30:03,01/Sep/2017 09:30:03
Table OCS_OFFER_STATE_2,12902213,01/Sep/2017 09:30:03,01/Sep/2017 09:30:03
Table OCS_STATIC_2,5094735,01/Sep/2017 09:30:03,01/Sep/2017 09:30:03
Table FC_SAPIST_ALL_ITEMS,4579021,01/Sep/2017 02:40:54,01/Sep/2017 02:40:54
Table FC_SAPIST_OPEN_ITEMS,653676,01/Sep/2017 00:30:05,01/Sep/2017 00:30:05
Table FC_SAPIST_DY_ALL,993408,01/Sep/2017 12:46:46,01/Sep/2017 12:46:46
Table SC_LOAN_OVERVIEW_FACT_II,1392218,01/Sep/2017 08:10:31,01/Sep/2017 08:10:31
PPL_USAGE,21397132,01/Sep/2017 06:19:27,01/Sep/2017 06:19:27
PPL_USAGE,20339944,01/Sep/2017 10:20:16,01/Sep/2017 10:20:16
Table PPL_CH_USAGE,178,01/Sep/2017 09:03:30,01/Sep/2017 09:03:30
为了将它们加载到 oracle 表中,如何删除“Table”一词及其后的空格?
例如,所需的输出将是:
PPL_CH_USAGE,178,01/Sep/2017 09:03:30,01/Sep/2017 09:03:30
PPL_INVOICE,22015731,01/Sep/2017 05:30:21,01/Sep/2017 05:30:21
PPL_LIABILITY,2468705,01/Sep/2017 06:56:41,01/Sep/2017 06:56:41
MBBSCS_PPL_INVOICE,3768639,01/Sep/2017 07:00:15,01/Sep/2017 07:00:15
MBBSCS_PPL_USAGE,1914718,01/Sep/2017 20:02:03,01/Sep/2017 20:02:03
CONTRACT_MSISDN,3785568,01/Sep/2017 04:00:26,01/Sep/2017 04:00:26
OCS_OFFER_CONF_2,16838060,01/Sep/2017 09:30:03,01/Sep/2017 09:30:03
OCS_OFFER_STATE_2,12902213,01/Sep/2017 09:30:03,01/Sep/2017 09:30:03
FC_SAPIST_DY_ALL,993408,01/Sep/2017 12:46:46,01/Sep/2017 12:46:46
OCS_STATIC_2,5094735,01/Sep/2017 09:30:03,01/Sep/2017 09:30:03
FC_SAPIST_ALL_ITEMS,4579021,01/Sep/2017 02:40:54,01/Sep/2017 02:40:54
FC_SAPIST_OPEN_ITEMS,653676,01/Sep/2017 00:30:05,01/Sep/2017 00:30:05
SC_LOAN_OVERVIEW_FACT_II,1392218,01/Sep/2017 08:10:31,01/Sep/2017 08:10:31
PPL_USAGE,21397132,01/Sep/2017 06:19:27,01/Sep/2017 06:19:27
PPL_USAGE,20339944,01/Sep/2017 10:20:16,01/Sep/2017 10:20:16
PPL_CH_USAGE,178,01/Sep/2017 09:03:30,01/Sep/2017 09:03:30
请帮助我:)
非常感谢!
最佳答案
sed 's/^Table //g' -i to_load_pplp.csv
s代表替换,-i
选项替换文件。
关于mysql - sed 从 .csv 中删除单词 + 空格 |优尼克斯 |太阳系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46078211/
我是一名优秀的程序员,十分优秀!