regex - Perl - need to copy only function name -


i have text file contains following data input

chainctrlbuildchain() : chaincontroller.c chainctrldumpchain() : chaincontroller.c chainctrldumpchancallback() : chaincontroller.c chainctrlexit() : chaincontroller.c chainctrlgetbitstreamchan() : chaincontroller.c chainctrlinit() : chaincontroller.c 

i want copy function names text file.

output needed

chainctrlbuildchain chainctrldumpchain chainctrldumpchancallback chainctrlexit chainctrlgetbitstreamchan chainctrlinit 

by using user4035 code

  $text =~ s/\s:\s.*//g; 

i got "()" outside function body like

chainctrlbuildchain() chainctrldumpchain()     

any tips.how can it.

i need make generalized code coz function name , class name different depending on user input.

perl -p -e 's/\(.*//' input.file 

look open parenthesis , after it, , delete all. -p means read input file arguments or standard input line-by-line, , after each line, print what's left of $_ after script in argument -e option has executed.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -