[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: missing way to extract data out of data
From: |
Dale R. Worley |
Subject: |
Re: missing way to extract data out of data |
Date: |
Thu, 18 Mar 2021 21:02:43 -0400 |
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 <=
- Re: missing way to extract data out of data, Alex fxmbsw7 Ratchev, 2021/03/19
- 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