Zary Necheva wrote:
> 
> Hi everyone,

Hello,

> How can I extract the text before the first occurrence of dot (.) or
> single space  from the first field.
> 
> This is my file
> 
> LB1571 5TH .W43 1993|text1|text1|
> FICT. V.12|text2|text2|
> FICT.|text3|text3|
> HQ806 .B35 1995|text4|text4|
> G530.T6B4941988Q|text5|text5|
> MPCD11 .B42 P27|text6|text6|
> .....
> C |textn|textn
> 
> This is the output  that  I need
> 
> LB1571|tex1|text1|
> FICT|text2|text2|
> FICT|text3|text3|
> HQ806|text4|text4|
> G530|text5|text5
> MPCD11|text6|text6
> .....
> C |textn|textn


perl -pe's/^([^ .]+)[^|]*/$1/' yourfile



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to