Skip to main content
bash is not central to the question
Link
Jeff Schaller
  • 68.9k
  • 35
  • 122
  • 268
Source Link
newbie_girl
  • 153
  • 1
  • 2
  • 6

Replacing string with other string

In line((s) that originate from csv file)

14/Feb/2016:15:21:33-0500]http://map1.link.de/mk

what is the easiest part to replace/delete&add

]http://map1.link.de/

with

,

having in mind that after map can come any number map1, map2, map3

Example of couple of lines:

14/Feb/2016:15:21:33-0500]http://map1.link.de/mk
14/Feb/2016:16:21:33-0500]http://map5.link.de/mk

Final result

14/Feb/2016:15:21:33-0500,mk
14/Feb/2016:16:21:33-0500,mk