[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Feature Request: scanf-like parsing
From: |
William Park |
Subject: |
Feature Request: scanf-like parsing |
Date: |
Fri, 22 Jan 2021 00:29:20 -0500 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
Another feature request:
To parse out simple thing like IP components, you can do something like
IFS=. read a b c d <<< "11.22.33.44"
But, if data are buried in a mess, then it's very labour-intensive to
dig them out. It might be useful to have scanf()-like feature, where
stdin or string are read and parsed according to the usual format
string. I guess, it would actually be sscanf(), since 'read' builtin
reads a line first. Since you're dealing with strings, only %s, %c, and
%[] are sufficient.
Where it would be used:
- everywhere, really everywhere.
Advantage:
- You can concentrate on "business logic", and less time on
bookkeeping.
--
William Park <opengeometry@yahoo.ca>
- Feature Request: scanf-like parsing,
William Park <=
- Re: Feature Request: scanf-like parsing, L A Walsh, 2021/01/22
- Re: Feature Request: scanf-like parsing, Chet Ramey, 2021/01/22
- Re: Feature Request: scanf-like parsing, Saint Michael, 2021/01/22
- Re: Feature Request: scanf-like parsing, Daniel Colascione, 2021/01/22
- Re: Feature Request: scanf-like parsing, pepa65, 2021/01/22
- Re: Feature Request: scanf-like parsing, Chet Ramey, 2021/01/22
- Re: Feature Request: scanf-like parsing, Greg Wooledge, 2021/01/22
- Re: Feature Request: scanf-like parsing, pepa65, 2021/01/22
- Re: Feature Request: scanf-like parsing, Léa Gris, 2021/01/22
- Re: Feature Request: scanf-like parsing, Oğuz, 2021/01/22