我有一個名爲sso_med.txt與AWK查找和替換
insert into brs.user_components (user_name, component_id, created_date, created_by, last_updated_date, last_updated_by) values ('502683504',16,current_date, '502264160', current_date, '502264160');
insert into brs.user_components (user_name, component_id, created_date, created_by, last_updated_date, last_updated_by) values ('502689031',15,current_date, '502264160', current_date, '502264160');
insert into brs.user_components (user_name, component_id, created_date, created_by, last_updated_date, last_updated_by) values ('502689031',16,current_date, '502264160', current_date, '502264160');
insert into brs.user_components (user_name, component_id, created_date, created_by, last_updated_date, last_updated_by) values ('212462117', 15, current_date, '502264160', current_date, '502264160');
insert into brs.user_components (user_name, component_id, created_date, created_by, last_updated_date, last_updated_by) values ('212462117', 16, current_date, '502264160', current_date, '502264160');
我想'502689031',16,current_date,
之間引入一個空間的文件所以,我想下面的命令
awk '{gsub(/,[0-9a-zA-Z]/, ", "); print}' sso_med.txt
但我我沒有得到我期待的東西
insert into brs.user_components (user_name, component_id, created_date, created_by, last_updated_date, last_updated_by) values ('502683504', 6, urrent_date, '502264160', current_date, '502264160');
insert into brs.user_components (user_name, component_id, created_date, created_by, last_updated_date, last_updated_by) values ('502689031', 5, urrent_date, '502264160', current_date, '502264160');
insert into brs.user_components (user_name, component_id, created_date, created_by, last_updated_date, last_updated_by) values ('502689031', 6, urrent_date, '502264160', current_date, '502264160');
其從CURRENT_DATE切出「c」和從數字「1」,並與空間 – sromit