Oct 25, 2007 #1 rickcfl Programmer Joined Oct 25, 2007 Messages 1 Location US Can anyone tell me how to extract only the text between two patters from a record and store it in a variable? Thanks in advance for any help here...
Can anyone tell me how to extract only the text between two patters from a record and store it in a variable? Thanks in advance for any help here...
Oct 27, 2007 #2 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR In your awk manual have a look at the sub function. You may also consider the match and substr functions. Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
In your awk manual have a look at the sub function. You may also consider the match and substr functions. Hope This Helps, PH. FAQ219-2884 FAQ181-2886
Oct 28, 2007 #3 feherke Programmer Joined Aug 5, 2002 Messages 9,541 Location RO Hi Or depending on the context setting the [tt]FS[/tt] may also help : Code: [blue]master #[/blue] echo 'Who the ( censored ugly word ) is Alice ?' | awk -F'\\(|\\)' '{print$2}' censored ugly word Feherke. http://rootshell.be/~feherke/ Upvote 0 Downvote
Hi Or depending on the context setting the [tt]FS[/tt] may also help : Code: [blue]master #[/blue] echo 'Who the ( censored ugly word ) is Alice ?' | awk -F'\\(|\\)' '{print$2}' censored ugly word Feherke. http://rootshell.be/~feherke/