summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--csv2oneline.sed19
1 files changed, 19 insertions, 0 deletions
diff --git a/csv2oneline.sed b/csv2oneline.sed
new file mode 100644
index 0000000..b698954
--- /dev/null
+++ b/csv2oneline.sed
@@ -0,0 +1,19 @@
+# if last line, print and exit
+$ { p; b; }
+
+# copy pattern in hold, read next line
+h; n;
+
+# while line ok print
+:checkline
+/^[A-Z]\{4\}-[0-9]\{5\}/ {
+ # clean and print previous
+ x; s/\n/ /g; p;
+ # if last line, print and exit
+ $ { x; p; b; }
+ # read next line
+ n; b checkline;
+}
+
+# append, clean, print
+H; n; b checkline;