I've seen an interesting question, mine is just the opposite.
I have a text file containing the following:
?Hadoop functions and tutorial?
https://abc. com/id=abc?33m?
? java function tutorial
https://abc .com/id=?bc?33m?
I've text file content below:
?Hadoop functions ?and tutorial
https://abc. com/id=abc?33m?
? java function tutorial
https://abc. com/id=?bc?33m?
I want to delete all the questions marks but they should not be removed from the lines containing https/http/HTTPS/HTTP.
I used following script below:
cat fi.txt |grep ^?|sed 's#?##g' >title.txt;cat fi.txt|grep ^https >url.txt;paste title.txt url.txt
Please help with opposite match function in sed
or Awk (delete ? text but not from lines which contain https).