c++でまとめてみたw ひまだなぁ。
main.cpp
#include <fstream>
#include <iostream>
#include <string>
#include <iterator>
using namespace std;
int main(int argc,char *argv[]) {
if(argc<2){
cerr<<"set the param" <<endl;
return -1;
}
ifstream ifs(argv[1]);
string str;
if (ifs.fail()) {
cerr << "失敗" << endl;
return -1;
}
while (getline(ifs, str)) {
if(str[0]=='-' && str[1]=='-'){
cout << str <<endl;
continue;
}
if(str[0]=='R' && str[1]=='E' && str[2]=='M'){
cout << str <<endl;
continue;
}
if(*str.rbegin() != ';') {
str=str + "'|| chr(10) ||'";
cout << str ; //ここが味噌かな
}else
cout << str <<endl;
}
return 0;
}