[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: missing way to extract data out of data
From: |
Alex fxmbsw7 Ratchev |
Subject: |
Re: missing way to extract data out of data |
Date: |
Fri, 19 Mar 2021 07:51:42 +0100 |
yea well it does wonders, however was looking for a way without spawning
externals like gawk.. maybe in future there will be =)
On Fri, Mar 19, 2021 at 2:02 AM Dale R. Worley <worley@alum.mit.edu> wrote:
> Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com> writes:
> > there is way to crop data to wanted, by cropping the exclulsions away
> > but what about a way to extract data, eg @( .. ) match
> > not about using [[ =~ but only var internal stuff
> > .. or do i miss there something
>
> If you want to do a pattern-match against a string, then extract a part
> of it, a common way is to use sed. For instance, to extract a word and
> remove spaces before and after it:
>
> $ STRING=' abc def '
> $ WORD="$( <<<$STRING sed -e 's/^ *\([^ ]*\) *$/\1/' )"
> $ echo "$WORD"
>
> It is common to use common Unix utilities to modify data items within
> shell scripts.
>
> Dale
>
- missing way to extract data out of data, Alex fxmbsw7 Ratchev, 2021/03/18
- Re: missing way to extract data out of data, Greg Wooledge, 2021/03/18
- Re: missing way to extract data out of data, Dale R. Worley, 2021/03/18
- Re: missing way to extract data out of data,
Alex fxmbsw7 Ratchev <=
- Re: missing way to extract data out of data, Dale R. Worley, 2021/03/19
- Re: missing way to extract data out of data, Greg Wooledge, 2021/03/19
- Re: missing way to extract data out of data, Dale R. Worley, 2021/03/22
- Re: missing way to extract data out of data, Andreas Schwab, 2021/03/23
- Re: missing way to extract data out of data, Dale R. Worley, 2021/03/24
- Re: missing way to extract data out of data, felix, 2021/03/25
- Re: missing way to extract data out of data, Eli Schwartz, 2021/03/24