summaryrefslogtreecommitdiffstats
path: root/csv2oneline.sed
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-08-13 12:07:26 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-08-13 12:07:26 +0200
commitd58e3e0cd5ee774c8c291b65c33f86c71b9353ce (patch)
tree6a2dc17b17a88905de288f1f739789313d110ee4 /csv2oneline.sed
parentabe41a1e45fe080b17c82172b9aec3de14334c12 (diff)
downloadbin-d58e3e0cd5ee774c8c291b65c33f86c71b9353ce.zip
bin-d58e3e0cd5ee774c8c291b65c33f86c71b9353ce.tar.gz
add csv2oneline.sed
Diffstat (limited to 'csv2oneline.sed')
-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;