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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:06:36+00:00 2026-05-13T20:06:36+00:00

We have a small project that involves automatically parsing some server/mail logs (among other

  • 0

We have a small project that involves automatically parsing some server/mail logs (among other things). Now, Plan A was to just hack together some Python and Django to do this properly grins, but I got veto-ed and the solution has to be pure-Excel, as it’s believed that will be more portable.

1. Importing tab-separated file

Our input file is a “CSV” file, but it’s actually a tab-separated file.

Something like:

"Server Name"   "Server Alias"  "1Feb09"    "2Feb09"    "3Fe09" "4Feb09"
"BobsServer"    "Foobar foobar" "34234" "23432" "52234" "23432"
"JanesServer"   "Foobar foobar" "30984" "34233" "34523" "92342"
"SamsServer"    "Foobar foobar" "12321" "23423" "23423" "23423"

etc.

I’m using the following VBA to import this:

Workbooks.OpenText Filename:="C:\logs.csv", Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(1, 1), TrailingMinusNumbers:=True

The funny thing is, when the file has a “.csv” extension, it seems to get mangled, and Excel shoves everything into one column. Yet, when the file extension is something else (e.g. “.txt”), it imports fine. It’s the exact same file each time Is this some quirk of how Excel handles file extensions and I’ve missed something?

I’m hoping I don’t need to do some hackery in VBA to rename the file each time, I suppose I can, but I’m actually curious why this is happening?

2. Pasting into existing worksheet

Second question, the above opens the CSV file as a whole new sheet, is there a way to instead do the above parsing, but insert it into a temporary new worksheet in our workbook?

3. Read entries, add to master table

The next step is to take our log file, and integrate that into our master worksheet, which contains histories for each server.

From my rather limited Excel knowledge, I was assuming that we’d do something like:

  1. Outer loop: Loop through our input
    log, line by line.
  2. Grab the servername, and do a vlookup for it in the master list.
  3. If it doesn’t exist, we create a new row for this server.
  4. Inner loop: Loop through each column
    of our log.
  5. Assuming the server is there now, we go back and grab the date in the log. We then do a
    hlookup in the master list for our date. We assume it doesn’t exist, however, if it does, we can just overwrite that cell. If it doesn’t exist, we need to find the right
    insertion date (there’s a chance there might be missing dates in the sequence) and insert our date.

Does the above logic seem sound? Or is there a more efficient way to do it in Excel? (I suspect there probably is, I don’t know the Excel object-model very well).

4. Sum up total across arbitrary date range

The final step is to actually calculate totals for the servers we want, based on an arbitrary date range. This is just going to be a macro function, that takes three arguments (server, start date, end date).

There’s a list of servers we’re specifically interested in, I’m guessing we’ll probably store this in a separate worksheet. Then we’ll just do a function call for each one in that list, and do a horizontal sum across the row, between the two dates. Is there some kind of shortcut I can use here for this part?

  • 1 1 Answer
  • 2 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-13T20:06:36+00:00Added an answer on May 13, 2026 at 8:06 pm

    Have you considered using Log Parser?

    Log parser is a powerful, versatile
    tool that provides universal query
    access to text-based data such as log
    files, XML files and CSV files, as
    well as key data sources on the
    Windows® operating system such as the
    Event Log, the Registry, the file
    system, and Active Directory®.

    • 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 project that involves sending some very small encrypted messages
I have a small project to record some form input on a page that's
I have a small project that I was using node-dirty for, but it's not
I have a small project that I will be working on shortly that collects
I have a small project and I noticed that I have a lot of
I have a small- to medium-size project that I am doing for my software
I have a small RIA that I built as a learning/make-my-life-easier project that uses
I have a small Visual studio add-in that walks down active project and insert
I have some small project to stream video to android device. Streaming is done
I have a small project that doesn't require much disk space, so i considered

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.