Search code examples
url-modification

batch convert weblinks by appending characters


is there any easy way to batch convert links by appending characters and provide batch output.

As shown in this picture

https://i.sstatic.net/DActh.png

The inputs will be given in batch as separate lines , and the output expected is batch in separate lines..

I do not have any programming background, so appreciate if you can direct me to any application that can easily do it without me writing the code else you can give me advice. I do have windows and MS office, so if there is something already in there, that can do it by writing a simple program, also let me know.


Solution

  • You can use regular expressions to achieve that. There are many online tools where you can transform your data without having tools installed locally.

    I prepared an expression for you here: https://regex101.com/r/l1ZUHZ/1

    Programmatically a solution could look like:

    /^(http.*)/![]($1)/gm
    

    A second example, that matches the protocol and replaces it with https: https://regex101.com/r/sufiUI/1

    /^https?(:.*)/![](https$1)/gm
    

    Sorting is a different task. I suppose you can do that in Excel for example. There's also a sort command available in Windows. To sort in reverse order you need the /r option.