help me :replacement

Hi
pls help me for below;

i have a file .content is :

uid,pcsPricingPlan,refPcsQosProfName
821910002022,smartlimit,SGSNQOS1

i have to replace the value of uid and pricingplan by a unix script.
may be the value would be next line or any where in the file.

pls help me on this

Your question is not specific. input+desired output describes your problem better.

INPUT file :

uid,pcsPricingPlan,refPcsQosProfName
821910002022,smartlimit,SGSNQOS1

Output will be :

uid,pcsPricingPlan,refPcsQosProfName
1234567,Nonstop ,SGSNQOS1
sed '2 s/^821910002022,smartlimit/1234567,Nonstop/; ' infile

Note: the pattern and the replacement are hard coded, if you give more details(rules to follow when performing pattern matching), we may coin a more useful pattern.

Actually i want to change uid,pcsPricingPlan values.
actual file :

uid = 821910002022
pcsPricingPlan = smartlimit

After Modifed:

uid = 1234567
pcsPricingPlan = nonstop

I assume your input file has fixed format, and you want to replace all occurences of uid = 821910002022 and pcsPricingPlan = smartlimit with 1234567 and Nonstop.
Simply remove 2 at the beginning of the script I provided:

sed 's/^821910002022,smartlimit/1234567,Nonstop/; ' infile

when i am running the script..the output is showing in console but the changed values are not saving in the file

You can add the i option(meaning replace in place):

sed -i 's/^821910002022,smartlimit/1234567,Nonstop/; ' infile

Good job.

You cannot replace the string and save the file at the same time using sed, below code will help you to achieve the objective.

#find and replace the string and save it a temp file
sed 's/^821910002022,smartlimit/1234567,Nonstop/; ' infile.txt > temp.txt
#rename the temp file to original file name
mv temp.txt infile.txt