This challenge needs to be solved in Python.
- You are given an
.txtfile.- example: sample_input.txt
- You are supposed to write a python program to get all the URLs from the file and convert them into anchor tags.
- example: sample_output.txt
For example,
will be replaced by
<a rel="noreferrer noopener" target="_blank" title="https://example.com" href="https://example.com" >https://example.com </a>
- rest of the content must be left EXACTLY as it was in the input file
- they should have the
rel,target,hrefandtitleproperties as shown in the above example. - your solution should be a
.pyfile with a functionanchor_that_url(input)which takes the path of a.txtfile. - the function should create an
output.txtfile which has the output. - test your code for various different inputs.
- do proper error handling.