how to trim all the [x] enclosed bracket footnotes from a long string of Wikipedia text?
0
votes
1
answer
159
views
I want to keep the paragraph structure but just delete all the enclosing brackets from text that is in the clipboard.
For instance - this text:
>The three stripes are Adidas' identity mark, having been used on the company's clothing and shoe designs as a marketing aid. The branding, which Adidas bought in 1952 from Finnish sports company Karhu Sports for the equivalent of 1,600 euros and two bottles of whiskey, became so successful that Dassler described Adidas as "The three stripes company".
I want it to be like this (no matter how long the text string):
>The three stripes are Adidas' identity mark, having been used on the company's clothing and shoe designs as a marketing aid. The branding, which Adidas bought in 1952 from Finnish sports company Karhu Sports for the equivalent of 1,600 euros and two bottles of whiskey, became so successful that Dassler described Adidas as "The three stripes company".
I've tried this but it deletes most of the string:
set theName to (the clipboard)
set y to characters 1 thru ¬
((offset of "[" in theName) - 2) ¬
of theName as string
I've tried also:
do shell script "sed -E -e 's|\\[.*||' -e 's|,||g' -e 's|^[ ]+||' -e 's|[ ]+$||'<<<" & theName's quoted form
Asked by Alex
(1 rep)
Oct 15, 2021, 04:30 PM
Last activity: Oct 18, 2021, 01:22 PM
Last activity: Oct 18, 2021, 01:22 PM