I have huge files, wherein some lines begin with a number. I want to convert that number to a bookmark link
Sample file:
Code:
C.S. Lewis (I think) wrote:
1 If war is ever
2 legal, then peace
3 is sometimes
4 sinful.
Text without numbers too
I need the numbers to be <a name tags where the id is the letter x and the number that is at the beginning of the line:
Code:
C.S. Lewis (I think) wrote:
<a name="x1">1</a> If war is ever
<a name="x2">2</a> legal, then peace
<a name="x3">3</a> is sometimes
<a name="x4">4</a> sinful.
Text without numbers too
I'm not sure why I can't get this, but after hours of 3 line long seds and endless while read lines, grepping ^[[:digits:]]s I can't figure it out. Any helpful suggestions would be appreciated... the files are lengthy, and there are bunches of them to go through.
Thanks