How to insert line of text @ specific line no

December 15, 2010 at 09:07:37
Specs: Windows XP
I need to insert the text M15 at every 275 lines. I have the counter working to get the line number but how do I insert the text in the file? I would like to use sed to do that

See More: How to insert line of text @ specific line no

Report •


#1
December 15, 2010 at 09:33:43
Using sed to insert text isn't easy. This link describes how to append a line after every Nth line:

http://main.rtfiber.com.tw/~changyj...

I think awk would be a better choice.


Report •

#2
December 17, 2010 at 05:23:33
Thanks,

After a little more research, awk is what I wound up using. I appreciate the reply


Report •

Related Solutions


Ask Question