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 7985479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:34:07+00:00 2026-06-04T11:34:07+00:00

I have several thousand log files with date-time stamps in them that mark certain

  • 0

I have several thousand log files with date-time stamps in them that mark certain important events. Unfortunately the information that is recorded at any given date-time stamp sometimes has newline characters inserted so that the information is spread over several lines. In addition, there is other information that is irrelevant for my purposes that doesn’t have a date-time stamp.

I’ve got a perl one-liner that does the job of pulling the information that I want out:

perl -ne 'print if /^\d\d:\d\d:\d\d\.\d\d\d/..!/^\d\d:\d\d:\d\d\.\d\d\d/'

However, I want to remove the new line characters after the initial line (that contains the date-time stamp) and each of the following lines. However, I do want to keep the newline character after the very last line before the next line that starts with a date-time stamp.

I’m not having any luck on how to modify my one-liner to accomplish this.

  • 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-06-04T11:34:09+00:00Added an answer on June 4, 2026 at 11:34 am
    perl -ne 'if ($inside = /^\d\d:\d\d:\d\d\.\d\d\d/..!/^\d\d:\d\d:\d\d\.\d\d\d/) {
                chomp unless $inside =~ /E0$/;
                print; }'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a system that will have several hundred thousand XML files,
I have a situation where we have several thousand image files that have become
I have a directory with several thousand text files that I need to process.
We have a CMS which has several thousand text/html files in it. It turns
I have a table (table variable in-fact) that holds several thousand (50k approx) rows
I have a grid with several thousand rows that can be filtered and sorted.
We have a scripting engine (running under Windows) that launches another application several thousand
I have a C# application that needs to be run several thousand times. Currently
I have several hundred thousand endpoint URLs that I want to generate stats for.
I have several thousand lines of delimited data. Unfortunately some of my data wrapped

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.