I have a large text file (Several hundred lines) and I need to take line 21 through line 28 and copy them to line 41, shunting all the text below down to make space.
It looks like it should be obvious, but I can't for the life of me figure out how to do it. Could someone please point my dumb arse in the right direction please?
Ta - LinkJames
Moving part of a textfile - where to start?
Moderator: General Moderators
Don't try and do it within the text file.
Take line 1 - 20 and put it into $first or something.
Then line 21-28 into $second
Line 29-40 into $third
Line 41 + to $forth.
Take line 1 - 20 and put it into $first or something.
Then line 21-28 into $second
Line 29-40 into $third
Line 41 + to $forth.
Code: Select all
$file = $first.$second.$third.$second.$forth;