suppose u have a file
ABC CDF ADF FDG HAA AHH AHA
so output shud be like
"ABC" "CDF" "ADF" FDG " "HAA" "AHH" "AHA"
suppose u have a file
ABC CDF ADF FDG HAA AHH AHA
so output shud be like
"ABC" "CDF" "ADF" FDG " "HAA" "AHH" "AHA"
while read N
do
for d in N
do
echo \"$d\"
done
done <file
sed 's/[^ ]*/"&"/g' filename
echo "ABC CDF ADF FDG HAA AHH AHA" | awk '{ for ( i=1; i<=NF; i++ ) { printf "\"%s\" ", $i } }END{ printf "\n" }'
as simple as this...using sed..
sed 's/[a-zA-Z]*/"&"/g' filename
cheers,
Devaraj Takhellambam
Hi, try this one.
echo ABC CDF ADF FDG HAA AHH AHA | sed 's/\([a-zA-Z]\{3\}\)/\"&\"/g'
same thing i wanted to try using file
but it is not working
inputfile.txt
content is "ABC CDF ADF FDG HAA AHH AHA"
this works
if follows wht cherry have written
sed 's/\([a-zA-Z]\{3\}\)/\"&\"/g' <input.text
where urs input.txt contains contents ABC CDF ADF FDG HAA AHH AHA..
check
Hi,
I hope the following will give the required output:
echo '"'`sed 's/ /" "/g' ns.txt`'"'
The file ns.txt will have ABC CDF ADF FDG HAA AHH AHA
Regards,
Chella