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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:39:32+00:00 2026-06-02T14:39:32+00:00

Okay so I’m processing searchlogs with a java class, but at some point I

  • 0

Okay so I’m processing searchlogs with a java class, but at some point I stumbled upon a tricky part in the logs:

generally, the log lines look like this:

217 yahoo.com   2006-05-16 16:35:31     

With the first number being the user id, the string after that being the query and the timestamp afterwards.
So far so good, I managed to extract the userid and used .split(‘:’) and split(‘-‘) to get the parts of the timestamp. But further down in the log the composition of the lines gets a bit unpleasant – for example, there are lines like the following:

217 -   2006-05-18 18:20:10 1   http://www.theonering.net
1268    osteen-schatzberg.com   2006-03-21 17:55:42 1   http://www.osteen-schatzberg.com

In the first line, the ‘-‘ seems to mark an empty query or w/e, and the url at the end is marked as ‘clickurl’. With lines like those, my idea of using split() to recieve the timestamp (and also the query) went to hell…

Does anyone have a good idea how to approach this problem?

Thanks in advance

  • 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-02T14:39:38+00:00Added an answer on June 2, 2026 at 2:39 pm

    What if you split the string by spaces first? Example (pseudocode):

     string = nextLineInFile;
     string[] data = (fill with nextLineInFile broken up by spaces/whitespace);
    

    Now data[0] holds the user id, data[1] holds the query, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, I have setup up a handler for a div click but for some
Okay I got some good advice for Mobile Detection but still having an issue
Okay so im working on this php image upload system but for some reason
Okay, so this seems simple, but I can't think of a straightforward solution; Basically
Okay, I feel like I should be able to do this, but I have
Okay. Tough to find the best starting point, here. The error XCode (4.3.2) in
Okay, so this is a long long shot but here it goes... When IE
Okay, so the answer to my question might not be the problem but here's
Okay I am having some problems with being able to change bitmaps when a
Okay, I'll say now that I know very little about Java. I was given

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.