implement --for-each, --before-records, --after-records v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Tue, 07 May 2019 16:37:37 +0200
branchv_0
changeset 15 ba91a464d2b3
parent 14 f407f2a2871d
child 16 4e8fe4cc70f0
implement --for-each, --before-records, --after-records
src/AwkHandler.h
--- a/src/AwkHandler.h	Tue May 07 01:03:21 2019 +0200
+++ b/src/AwkHandler.h	Tue May 07 16:37:37 2019 +0200
@@ -192,13 +192,16 @@
 				std::wstringstream awkScript;
 				awkScript << L"BEGIN {" << std::endl;
 				awkScript << L"FS=\"\\t\";" << std::endl;
+				awkScript << currentRelationConfiguration->awkBeforeRecords << std::endl;
 				awkScript << L"};" << std::endl;
+				awkScript << std::endl;
 
 				awkScript << L"END {" << std::endl;
-				// awkScript << … << std::endl;
+				awkScript << currentRelationConfiguration->awkAfterRecords << std::endl;
 				awkScript << L"};" << std::endl;
+				awkScript << std::endl;
 
-				awkScript << L"{print \"AWK says: line \" NR \" '\" $0 \"' has \" NF \" fields; first field is '\" $1 \"'\";}" << std::endl;
+				awkScript << currentRelationConfiguration->awkForEach << std::endl;
 
 				// CLI arguments:
 				std::vector<std::string> args;