From d58e3e0cd5ee774c8c291b65c33f86c71b9353ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 13 Aug 2014 12:07:26 +0200 Subject: add csv2oneline.sed --- csv2oneline.sed | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 csv2oneline.sed 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; -- cgit v1.1-2-g2b99