[Top] [All Lists]

Re: anno -nodate -component subject -text "hi foo"$'\n'" bar"$'\n'" baz" << Thanks Ralph.

2021-07-17 06:34:52
On Sat 7/17/21 12:26 +0100 Ralph Corderoy wrote:
Hi Tom,


    $ anno -nodate -component subject -text "hi foo"$'\n'"  bar"$'\n'"  baz"

I was hoping above would add only one subject header. Is there a way to
do that?

No, I don't think so.

shows -text's argument being written to the field, preceded by the field
name, once for each line-feed-separated chunk.

You could cheat and consider if you know a character won't occur in the
file which you could use as a placeholder for the line feed.

   $ echo a: 1 >1
   $ anno -nodate -component subject -text $'hi foo\r bar\r xyzzy' +. 1
   $ sed -n l 1
   subject: hi foo\r bar\r xyzzy$
   a: 1$
   $ sed -i 's/\r/\n/g' 1
   $ sed -n l 1
   subject: hi foo$
   a: 1$

Thanks Ralph. I may add in a work around like yours.


<Prev in Thread] Current Thread [Next in Thread>