awk.
cat file | awk '{print "z=z+"$1}'
Proof:
bob@donelle:~> printf " 1234960\n1456780\n3456567\n5476865\n456098\n" | awk
'{print "z=z+"$1}'
z=z+1234960
z=z+1456780
z=z+3456567
z=z+5476865
z=z+456098
bob@donelle:~>
BTW - you are prepending, not appending.
George
Support wrote:
>
> HI
>
> Any sed gurus on the list? I use it often in a class I am taking but I
> am stuck on this one and have had no luck with the docs I have found.
> What I need to do is append 'z=z+' to the beginning of every line in a
> file.
>
> The file looks like this:
>
> 1234960
> 1456780
> 3456567
> 5476865
> 456098
>
> thats it 1 simple column! Maybe I need some sleep it is 1 am here in
> Germany.
>
> Thanks for any help!
> (I know you are out there der hans) :)
>
> ________________________________________________
> See http://PLUG.phoenix.az.us/navigator-mail.shtml if your mail doesn't post to the list quickly and you use Netscape to write mail.
>
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss