[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] first part
From: |
Richard Lohman |
Subject: |
Re: [Help-bash] first part |
Date: |
Sat, 21 May 2016 08:10:26 -0500 |
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
>
>