hi,
anyone can give a sample command on sed
. the text file date list belows;
test.txt
"a","bbb",123
"b","ccc",234
"c","eee",456
output i need to add these word "xxx"
"xxx","a","bbb",123
"xxx","b","ccc",234
"xxx" ,"c","eee",456
thanks in advance,
FSP
using awk..
-bash-3.2$ cat list3
"a","bbb",123
"b","ccc",234
"c","eee",456
-bash-3.2$ awk '{print "\"xxx\"",$0}' list3
"xxx" "a","bbb",123
"xxx" "b","ccc",234
"xxx" "c","eee",456
-bash-3.2$
sed..
-bash-3.2$ sed 's/^/"xxx",&/g' list3
"xxx","a","bbb",123
"xxx","b","ccc",234
"xxx","c","eee",456
-bash-3.2$
And if you were editing the file with vi, you could use
:%s/.*/"xxx",&/
If you created a file, call it ex.cmds, like this
:%s/.*/"xxx",&/
:x
then you could alter your file with
ex test.txt < ex.cmds
many many thanks for the input