0

From the following line of text:

ab•di•ca•tion

I want to produce the following line:

abdication  ab•di•ca•tion

(where the space between is a tab). This to iterate over multiple lines.

I can't find a way of 'filtering out' or excluding the • character from the results.

I'm currently using BBEdit on MacOS, but if someone can offer a Unix command line method, that would be equally acceptable.

benwiggy
  • 1,440
  • 17
  • 35

1 Answers1

2

We suggest the following sed solution:

   term="ab•di•ca•tion"; echo $(echo "$term" | sed "s|•||g") " $term";

or simpler:

   term="ab•di•ca•tion"; printf "%s %s" $(echo "$term" | sed "s|•||g") " $term";

And simpler solution with awk

    echo "ab•di•ca•tion"| awk '{a=$0;gsub("•","");print $0 " " a}'
Dudi Boy
  • 4,551
  • 1
  • 15
  • 30