09-06-2023, 11:21 AM
Replace nth to All Occurrences with Sed
Use sed to replace patterns from the nth to all occurrences in a line:
sed 's/old_string/new_string/#g' samplefile.txt
For example, to replace "pisces" with "aquarius" from the second occurrence to all occurrences:
sed 's/pisces/aquarius/2g' astrology.txt

