On 29Jan2016 19:07, Mike Wright <nob...@nospam.hostisimo.com> wrote:
Don't know whether this requires a "sed" and/or an "awk" solution. I have strings in a log file whose only important info for a digest are new strings containing the date, time, and the remainder of the line following the first occurrence of a hyphen. All delimiters are spaces until the first hyhpen (there may be multiple hyphens but I only care about the first).

Here is what the original line looks like:

date time txt1 txt2 txt3: txt4 txt5 txt6 txt7 domain-email

Here is what I'm looking for:

date time partFollowingHyphen1

Presuming date and time have no spaces, untested:

 sed 's/^\([^ ][^ ]*  *[^ ][^ ]*\) [^-]*-\(.*\)/\1 \2/'

You'll have to show us an example line if that doesn't work.

Cheers,
Cameron Simpson <c...@zip.com.au>
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org

Reply via email to