help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] first part


From: Val Krem
Subject: Re: [Help-bash] first part
Date: Sat, 21 May 2016 13:54:28 +0000 (UTC)

Thank you Richard!






On Saturday, May 21, 2016 8:18 AM, Richard Lohman <address@hidden> wrote:
Pipe the output of the field into awk:

echo $field | awk -F '-' '{print $1}'

On May 21, 2016 7:45 AM, "Val Krem" <address@hidden> wrote:

>
>
> Hi all,
> I  have field  that look like the following
> 124-20-25
> 014-2012-26
> 1024-212-27
> 1-001-29
>
> I want extract the first part of the string,  prior to the first "-"
> 124
> 014
> 1024
>
> 1
>
> How do I do I that?
> Thank you in advance
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]