View Single Post
Old 10-17-2013, 12:38 PM   #1
Aeris
Developer's Corner Mascot
Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.
 
Aeris's Avatar
 
Posts: 486
Karma: 1277790
Join Date: Sep 2013
Device: Kindle Paperwhite 5.3.4, Kindle Keyboard 3.4
Manipulate "My Clippings" through command line

I've found this nice script to export from a file all the text between two word/string:

Code:
sed '/WORD1 a /!d;s//&\n/;s/.*\n//;:a;/WORD2/bb;$!{n;ba};:b;s//\n&/;P;D' inputfile.txt > output.txt
where WORD1 and WORD2 are these words . It runs beautifully on linux, but if i try to execute it on kindle it gives me this error:

Code:
sed: can't find label for jump to 'a}'
I don't know how to fix it also because I've no idea what does all these paramaeters do in sed command (I know how it works only for simple tasks).

Does anybody know why on kindle it doesn't works as it does on linux? Or another script to do the same task? I've searched a lot through sed / awk forums but can't find nothing other than this...
Aeris is offline   Reply With Quote