Requirement of Spliting a text file in UNIX Programing

Hi,

There is a requirement, needs to split the text file based on RC code present in text file.
For this, needs to write a unix shell programing script for the above requirement.

For example in text file, if there are distinct RC codes, then we needs to split into multiple text files. In this text file RC codes(9102 and 9103) are to be split in to 2 separate files.

Please find attached is the text file.

Could you please help me to get complete program logic for this requirement.

If you need more info please let me know.

Try this:

awk -F'[= ]' '/^ RC=/{rc=$3}rc{print>>rc".txt"}' file