in reply to Parse a file, replace a particular strings and save new file

Welcome to the Monastery.

The following code solves your problem as specified.

If it does not do what you WANT, you need to improve your specification.

perl -pe '$x++ ? s/\bvalues\b/100 for string_name100(Transition_11)/ : s/\bvalues\b/500 for string_name500(Transition_11)/ ' FileName.lib > NewFileName.lib
Of course, it would help if you showed us what you TRIED, and explain what you have trouble with.

Please read How do I post a question effectively?.

             When in doubt, mumble; when in trouble, delegate; when in charge, ponder. -- James H. Boren