I have the line number 55 in a text file which I want to move just before line number 23 in the same text file. I know that you can move lines up by a certain number of lines 1, 2 but is it possible to append or prepend a line to another line instead of the verbose way of moving lines up or down a textfile?
I am open to answers using vim, sed or any other command line tool but the more concise the better
update:
The sed
command i
inserts text before a line which is similar to what I am looking for except that I want to insert a line before a line
ed
, have you tried them? – RomanPerekhrest Jul 21 '19 at 19:27ed
but I also missed those solutions because I didn't scroll down far enough – bit Jul 21 '19 at 19:45