need a good text file manipulator

rubix

Golden Member
Oct 16, 1999
1,302
2
0
i need a program that will let me insert something to the beginning of every line and to the end of every line.

say i had a txt file with 1000 lines of this:

file1.zip
file2.zip
.
.
file1000.zip

i want to insert to the front of all lines this:

<a.href=http://www.blah.com/

and to the end of all lines this:

>xxxxxxxxxx</A>

so now i will have a lot of links if i add some html header. how can i do this? it's too much to do manually.
 

geoff2k

Golden Member
Sep 2, 2000
1,929
0
76
Learn perl:

perl -n -e "chop; print '<blah>' . $_ . '</blah>';" < input.txt
 

Lint21

Senior member
Oct 9, 1999
508
0
0
While Perl and Awk will certainly do that, there is an easier way for people that don't want to learn a language just to accomplish something so simple. UltraEdit is a really nice text editor that has a feature called "column mode". It will allow you to add that HTML tag to your file, or change everything from file1.zip to booger1.zip, or whatever.