- 论坛徽章:
- 7
|
本帖最后由 tuyajie 于 2015-07-31 11:25 编辑
- sed '1d' test | sed 's/^[^,]*,[^,]*,//' | awk 'BEGIN{getline;print "create table yourTableName ("$1" String,"$2" String,"$3" String,"$4" String,"$5" String,);"}{print "insert into yourTableName values (\""$1"\",\""$2"\",\""$3"\",\""$4"\",\""$5"\");"}'
- create table yourTableName (LV String,NAME String,LPs String,PPs String,DISTRIBUTION String,);
- insert into yourTableName values ("hd10opt","32","32","28..00..04..00..00","/opt");
- insert into yourTableName values ("hd2","71","71","00..04..31..36..00","/usr");
- insert into yourTableName values ("hd9var","84","84","00..46..38..00..00","/var");
- insert into yourTableName values ("hd3","80","80","00..00..80..00..00","/tmp");
- insert into yourTableName values ("hd1","1","1","00..00..01..00..00","/home");
- insert into yourTableName values ("hd5","1","1","01..00..00..00..00","N/A");
- insert into yourTableName values ("hd6","11","11","00..04..00..00..07","N/A");
- insert into yourTableName values ("hd8","1","1","00..00..01..00..00","N/A");
- insert into yourTableName values ("hd4","3","3","00..00..03..00..00","/");
- insert into yourTableName values ("Plv_cicsregion","16","16","00..16..00..00..00","/var/cics_regions");
- insert into yourTableName values ("Plv_cicsserver","8","8","08..00..00..00..00","/var/cics_servers");
- insert into yourTableName values ("log_SFS_01","2","2","02..00..00..00..00","N/A");
- insert into yourTableName values ("sfs_SFS_01","2","2","02..00..00..00..00","N/A");
- insert into yourTableName values ("oralv","232","232","115..00..00..00..117","/u01");
- insert into yourTableName values ("lg_dumplv","8","8","00..08..00..00..00","N/A");
- insert into yourTableName values ("livedump","2","2","00..02..00..00..00","/var/adm/ras/livedump");
- insert into yourTableName values ("fslv00","80","80","00..80..00..00..00","/software");
- insert into yourTableName values ("waslv","160","160","04..00..00..124..32","/websphere");
- insert into yourTableName values ("hd11admin","1","1","00..00..01..00..00","/admin");
复制代码 茅塞顿开~~~~那就是拼字符串的体力活了。。呵呵。SQL细节记不清楚了,哈哈,凑合改改回复 10# MMMIX
|
|