Text file with time stamp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • honigtau
    New User
    • Feb 2010
    • 1

    Text file with time stamp

    Hi I have two directories with text files which I have to merge.
    Each text file has a time stamp per line like this:

    dirb\File1.txt
    [2009/12/08 18:11] text text
    [2009/12/08 19:39] text b

    dira\File1.txt
    [2009/12/08 18:15] a text
    [2009/12/08 22:22] b text

    At the end I would like to have one file:

    [2009/12/08 18:11] text text
    [2009/12/08 18:15] text1 text2
    [2009/12/08 19:39] text b
    [2009/12/08 22:22] b text

    I have no idea how to manage this with BC.
  • Aaron
    Team Scooter
    • Oct 2007
    • 16026

    #2
    Hello,

    You may be able to accomplish this with a combination of file filters and session settings.

    First, use the Sort file format. It is included by default, but would not be associated with your files. If your files have a unique extension, go to the Tools menu -> File Formats. Select Sorted and perform a Save As, and give it a file mask associated with your files (*.txt if you plan to only use with all *.txt files.)
    If you do not want all *.txt files to open sorted, then skip that step.

    Open your pair of files in a Text Compare session. Go to the Session menu -> Session Settings. In the format tab, change from Detected to "Sorted". Then in the Alignment tab, enable Never Align Differences.


    Your files should now appear to be sorted, and the timestamps should be able to be copied from one side into the other at the correct times. This should work for your above example, but assumes your timestamps will be alphabetically in order (18 vs 19 works; but do you have 09vs10 or 9vs10?).

    Another issue that may come up is that groups of times will be out of order in the merged file.
    [2009/12/08 18:11] text text
    [2009/12/08 19:39] text b
    [2009/12/08 18:15] a text
    [2009/12/08 22:22] b text

    To correct this, refresh and resort, then perform a Save As to save it in order.


    Another option would be to use the Data Compare, and use ] delimited columns or fixed width columns. For your example, I used fixed width columns, under the File Format (golden button next to the referee/rules/session settings button, or by creating a new File Format of the Data Compare type). I used 1;16;1, then mark column 2 as the Key column, which should be detected as a date and time. (This would avoid issues such as 9vs10 or 09vs10). Otherwise you can use 18, which will detect as text instead of a date/time.

    If you would like some more specific help, please email [email protected] with specific files and your Support.zip package (Help menu -> Support; Export). Please do not post your support.zip here, since it will contain all of your settings and some private information such as windows account name, etc.

    **If you do email us, please also include a link back to this forum post.**
    Aaron P Scooter Software

    Comment

    Working...