Re: sed r option | insert file

"[email protected] [sed-users]" <[email protected]> 19 Dec 2016 07:15:12 -0800
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>

 >      sed      '        /start/,/stop/r file.txt         '
 

 

 1. the above will execute the "r" command foreach line in the block including
 the boundaries.
 2. first the pattern space is printed then the "r" file is scheduled for flush; unless interrupted by the N/n or -n option.
 3. default action is print pattern space, all the lines of block are printed and after each of these lines the "r" file.txt would be printed as well.
 

 

 

> The strange thing is that is only inserts 114 lines, then the block end
> appears. After that the same 114 are lines are printed again.
> I am not on drugs ...
 




---In [email protected], <Thierry.Blanc@...> wrote :

 I try to insert a textblock saved in a file (file1.txt) into another
 file (file2.txt). File 2 is an rdf file.
 
 file 1 should be inserted into a block and replace the content of the block.
 
 sed -r '
 /<RDF:Seq RDF:about="urn:scrapbook:item20161219002711">/,/<\/RDF:Seq>/{
 
 r file1.txt
 
 }' file2.txt
 
 The strange thing is that is only inserts 114 lines, then the block end
 appears. After that the same 114 are lines are printed again.
 
 I am not on drugs ...
 ???
 
 
 
 
 
 
 [Non-text portions of this message have been removed]



[Non-text portions of this message have been removed]