I have a text file which contains the following data:
ChainCtrlBuildChain() : ChainController.c
ChainCtrlDumpChain() : ChainController.c
ChainCtrlDumpChanCallback() : ChainController.c
ChainCtrlExit() : ChainController.c
ChainCtrlGetBitStreamChan() : ChainController.c
ChainCtrlInit() : ChainController.c
I want to copy only the function names into another text file.
My desired output:
ChainCtrlBuildChain
ChainCtrlDumpChain
ChainCtrlDumpChanCallback
ChainCtrlExit
ChainCtrlGetBitStreamChan
ChainCtrlInit
How can I do it?
Note that the function names and class names will be different depending on user input.
By using user4035's code,
$text =~ s/\s:\s.*//g;
I got "()" outside function body like
ChainCtrlBuildChain()
ChainCtrlDumpChain()