Reading txt files using the awk

Dear Shell scripters,

I have a small code which copy the txt files from some destination to file name OutPutFile. [1]
I want to modify this script to introduce several constant.

The string it is reading is like

/eos/uscms/store/user/pooja04//analysis2012/525/data/doubleele/2012/datav1/vgtree_320_1_YiM.root

I want the final string in the OUTPUTFILE to be like:

Chain->Add("/eos/uscms/store/user/pooja04//analysis2012/525/data/doubleele/2012/datav1/vgtree_320_1_YiM.root");

I don't know how to add these constant like [", ;] etc. Kindly help.

Thanks in advance
Pooja

SCRIPT [1]

#!/bin/bash                                                                                                                                                            
#usage ./copyTextFromCastor.sh $PATH $GREP $OUTPUTFILE                                                                                                                 

PATHNAME=$1
CONSTANT=Chain
GREP=$2
OUTPUT=$3
echo "Copying \"$1 | grep $2\" to $3"

ls -ltr "$PATHNAME" | grep "$2" | awk '{print string path $9}' string="$CONSTANT" path="$1"  > "$3"
echo "progressing ... please be patient..."

If you don't mind using sed, try

sed 's/^/Chain->Add("/; s/$/");/'

as a filter in your long pipe. It just replaces the start-of-string (^) with your first constant and the end-of-string ($) with the second.
If this does not do what you want, pls post more info on your problem, as I'm not sure I understand what your script is doing.

use in your script if that code is printing the output to your file

awk '{print string"->Add(\"" path $9"\");"}' string="$CONSTANT"  path="$1"