I have something like
dsadjakldjska safdsfdsfsf fdsfsf**STGN**fdsfsd fdsfkjldsf fdsff fdsfs**IRV**fdsfs and I want to get
dsadjakldjska safdsfdsfsf fdsfkjldsf fdsff fdsfsf**STGN**fdsfsd fdsfs**IRV**fdsfs but only for an interval of lines (say line 40000 till end of file) (moving the line containing STGN right above the next IRV underneath it)
Any idea how I can do this, or whether there's a better alternative for this than sed?