Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6005315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:22:50+00:00 2026-05-23T01:22:50+00:00

Not sure the most effient way to do this. Bash seems the easiest, I

  • 0

Not sure the most effient way to do this. Bash seems the easiest, I have a start on the date.

set -A mAMon N/A Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
sed -e 's/-/ /g' -e 's/\(.*:..\).\{4\}/\1/' -e 's/\.\([0-9]\)/ \1/g' -e 's/\./ /2' inp_file

I have figiured out how to extract columns, but not sure how to convert

This is what I have…

Code:

NEWDNS 04-Jun-2011 06:00:59.762 10.220.136.217 crl.verisign.com

This is what I need…. Change date, remove mil seconds, remove periods in the ips and remove the last dot in a url.

Code:

NEWDNS 2011-06-04 06:00:59 10 220 136 217 crl.verisign com

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:22:51+00:00Added an answer on May 23, 2026 at 1:22 am

    A perl way to do it:

    my %months = (Jan=>1, Feb=>2, Mar=>3, Apr=>4, May=>5, Jun=>6, Jul=>7, Aug=>8, Sep=>9, Oct=>10, Nov=>11, Dec=>12);
    while(<DATA>) {
        my @part = split;
        $part[1] =~ s/(\d+)-(\w+)-(\d+)/"$3-".sprintf('%02d',$months{$2})."-$1"/e;
        $part[2] =~ s/\.\d+$//;
        $part[3] =~ s/\./ /g;
        $part[4] =~ s/\.(\w+)$/ $1/;
        print "@part\n";
    }
    
    __DATA__
    NEWDNS 04-Jun-2011 06:00:59.762 10.220.136.217 crl.verisign.com
    

    output:

    NEWDNS 2011-06-04 06:00:59 10 220 136 217 crl.verisign com
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Although it seems pretty simple, I'm not sure of the most efficient way of
I'm not sure if this is the most optimal way of writing this code,
This is a really simple request, but I am not quite sure the easiest/most
This may be for most languages in general, but I'm not sure. I'm a
Not sure where to start, but I had gotten the most recent version of
Not sure exactly how to explain this but Imaging you have a table with
I'm not sure how to test this question. I have an ASP.NET page for
I am not sure the best way to accomplish this but I would like
This may be a really simple question, but I'm not sure what the most
Am not sure how to ask this question but for most of you more

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.