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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:47:30+00:00 2026-05-21T12:47:30+00:00

Is there a tool for Windows that can read the Delphi history files. and

  • 0

Is there a tool for Windows that can read the Delphi history files.
and extract the lines-of-code written per session along with the timestamps of the sessions.

What info do I want

session_id   date+time             filename      lines_of_code changed
1            1-1-2011 - 13:14:36   unit1.pas     100
....

What info do I have to extract this from
I’m using Delphi 2007.
And every change a in source file gets written to a subdir called history that looks like:

name                date_changed    type     size
project1.dpr.~1~    date-time       ~1~      1  kb
project1.dpr.~2~    date-time       ~2~      1  kb
unit1.pas.~1~       date-time       ~1~      83 kb
...

Every history file includes the full source code, not just the differences.
(so if you would like to revert back to a source file you can just code that file over the old)

Not subversion
For the future I’m going to use a subversion program to keep track of this stuff, but for the past stuff I want to have some record as well.
So unless a subversion clone can index the old source file backups in the history folder I’m not looking for that now.

  • 1 1 Answer
  • 3 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-21T12:47:30+00:00Added an answer on May 21, 2026 at 12:47 pm

    Virtually any Diff tool that generates so-called “diff compatible” diff files or “patches” can be used for the job. For example, I’m sure you can use this: http://gnuwin32.sourceforge.net/packages/diffutils.htm

    Simply invoke the command line tool giving as parameters the new and the old versions of the file and Annalise it’s output: You basically care about lines that start with a single - or +. This would give you a rough estimate of number of lines changed. If you want to get fancy you’ll need to modify your algorithm to properly detect changed blocks, but that’s a lot more difficult, because diff’s job is to generate output that’s used to transform the “old” file into a “new” files, not count changes. Line edits are usually shown as a deletion followed by an addition.

    Here are the problems you’ll face using diff:

    • Moved lines are shown as both DELETIONS and ADDITIONS and will likely be counted twice, even those all the programmer did was restructure the code a bit.
    • Edited lines might be counted more then once.

    Since you don’t care about the actual diff, and you want a rough estimate of changed lines of code, here’s an other very simple idea that provides you with a number. Not very accurate, but then again LOC counting is not exactly an accurate measure of programmer performance any way! This code looks at both OLD and NEW files and gives the number of lines found in OLD but not found in NEW plus the number of lines found in NEW but not found in OLD

    function CountLineChanges(const OldFile, NewFile:string):Integer;
    var OldL: TStringList;
        NewL: TStringList;
        i: Integer;
    
      procedure FillListWithStringsFromFile(const FileName: string; const L:TStringList);
      var F: TStringList;
          i,n: Integer;
          s: string;
      begin
        F := TStringList.Create;
        try
          F.LoadFromFile(FileName);
          for i:=0 to F.Count-1 do
          begin
            s := F[i];
            if L.IndexOf(s) = -1 then
              L.Add(s)
            else
              begin
                // Seeing this line again!
                n := 1;
                while L.IndexOf(s + '#' + IntToStr(n)) <> -1 do
                  Inc(n);
                L.Add(s + '#' + IntToStr(n));
              end;
          end;
        finally F.Free;
        end;
      end;
    
    begin
      OldL := TStringList.Create;
      try
        OldL.Sorted := True;
        NewL := TStringList.Create;
        try
          NewL.Sorted := True;
    
          FillListWithStringsFromFile(OldFile, OldL);
          FillListWithStringsFromFile(NewFile, NewL);
    
          Result := 0;
          for i:=0 to OldL.Count-1 do
            if NewL.IndexOf(OldL[i]) = -1 then
              Inc(Result);
          for i:=0 to NewL.Count-1 do
            if OldL.IndexOf(NewL[i]) = -1 then
              Inc(Result);
    
        finally NewL.Free;
        end;
      finally OldL.Free;
      end;
    end;
    

    Issues with this code:

    • Blocks of code moved from one place to the other give 0 as a result.
    • All edited lines are counted precisely twice.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any useful tool that can store history of my folder locally like
Is there any tool that can parse a valid C program and generate a
I recently read in a magazine that there is a new commercial developer tool
I have written a tool that is run on the command line. I can
Is there a good tool that I can try out to convert my .flv
Is there any .NET performance profiling tool out there that I can attach to
Not withstanding that there is currently no tool that can create one, is it
I am writing a command-line tool for Windows that uses libcurl to download files
I'm trying to find a tool for Windows that I can use to preview
Is there an OS or user-account level modification for windows 7 that I can

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.