+ Post New Thread
Results 1 to 6 of 6
General Chat Thread, .txt, .log, .rtf file joiner? in General; Not related to my post yesterday about a website IM program, Currently I'm using IPswitch IM system at one of ...
  1. #1
    Yeo695's Avatar
    Join Date
    Feb 2013
    Posts
    123
    Thank Post
    34
    Thanked 43 Times in 11 Posts
    Rep Power
    22

    .txt, .log, .rtf file joiner?

    Not related to my post yesterday about a website IM program,


    Currently I'm using IPswitch IM system at one of my school districts for teacher to teacher chat hosted on a local server and i'm pulling at least 10,000 IM chat logs in every other month in .rtf format . I've been able to combine them all by changing them to .txt files using (RTFtoUTXT) a free program used for changing mass amounts of .rtf files to .txt files. Then I proceed to use a program called simple file joined (SFJ) that joins all my logs together. But SFJ seems to be bugged and designed by a young child who was banging on a keyboard. Sometimes it will insert dividers written in Chinese text, other times it will put a bunch of script and file locations. When it does work though it puts triple spaces between all the charecters in a text document like "h e l l o".


    What I'm trying to get to Is does anyone know of a good program to combine .log, .rtf or .txt files
    without any issues and simple dividers?




    (To put things in perspective when finished i had about 2.4 millions words and 6,203 thousand pages on word with Calibri 10)


    Thanks

  2. #2
    Valyyn's Avatar
    Join Date
    Jun 2011
    Location
    Portsmouth
    Posts
    202
    Thank Post
    21
    Thanked 62 Times in 44 Posts
    Rep Power
    54
    I used this one years ago:
    Text file merging tool - TXTcollector, freeware!
    which I remember being pretty good, and does more than just .txt files

    Otherwise, you could probably get away with a .bat file, something like:
    Code:
    for %f in (*.txt) do type %f >> combined.txt

  3. #3
    Yeo695's Avatar
    Join Date
    Feb 2013
    Posts
    123
    Thank Post
    34
    Thanked 43 Times in 11 Posts
    Rep Power
    22
    .bat file would be hard. Wouldn't i have to type out each file name? like... (remember i dealing with 10,000+ files)

    "name.txt name.txt name.txt >masterfile.txt"

    And for txt collector I kept getting errors once i compiled them. I would list the title the "could not be written" after each one.

  4. #4
    Valyyn's Avatar
    Join Date
    Jun 2011
    Location
    Portsmouth
    Posts
    202
    Thank Post
    21
    Thanked 62 Times in 44 Posts
    Rep Power
    54
    That's a shame - txt collector used to be really good.

    That code I put in above should iterate through every .txt file in the folder and "type" the contents into the combined.txt file, so you wouldn't need to type out the filenames. (It will do every txt file in that folder though!)

    I don't think it does line breaks though, so you will probably end up with a bit of:

    File 1 starts here
    File 1 contents
    File 1 ends hereFile 2 starts here
    File 2 contents
    File 2 ends hereFile 3 starts here

    so not 100% ideal :/

  5. #5
    Yeo695's Avatar
    Join Date
    Feb 2013
    Posts
    123
    Thank Post
    34
    Thanked 43 Times in 11 Posts
    Rep Power
    22
    I'll keep messing around with it i'm bound to find something

  6. #6


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    8,894
    Thank Post
    226
    Thanked 2,674 Times in 1,971 Posts
    Rep Power
    786
    Quote Originally Posted by Yeo695 View Post
    does anyone know of a good program to combine .log or .txt files without any issues and simple dividers?
    PowerShell should do this easily. The two scripts below both do exactly the same thing - the only difference is the second one reads .txt files from every subdirectory within the source folder. Each file will be separated by a blank line in the concatenated text file.

    Code:
    $SourcePath = "C:\Source"
    $Pattern = "*.txt"
    $OutputFile = "C:\Destination\Combined.txt"
    
    [System.IO.Directory]::GetFiles($SourcePath, $Pattern) | ForEach-Object { [System.IO.File]::ReadAllText($_) + [Environment]::NewLine } | Out-File -filepath $OutputFile -Append
    Code:
    $SourcePath = "C:\Source"
    $Pattern = "*.txt"
    $OutputFile = "C:\Destination\Combined.txt"
    
    [System.IO.Directory]::GetFiles($SourcePath, $Pattern, [System.IO.SearchOption]::AllDirectories) | ForEach-Object { [System.IO.File]::ReadAllText($_) + [Environment]::NewLine } | Out-File -filepath $OutputFile -Append
    Note. Do not save the output file to the source folder, otherwise PowerShell will go into an infinite loop and fill your hard drive up.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 14
    Last Post: 26th November 2008, 10:10 AM
  2. Full chkdsk on reboot with log file??
    By actech in forum Windows
    Replies: 2
    Last Post: 9th May 2008, 10:09 PM
  3. Replies: 3
    Last Post: 1st March 2008, 11:26 AM
  4. prezzie batch file to collect dps logs
    By russdev in forum ICT KS3 SATS Tests
    Replies: 4
    Last Post: 16th May 2006, 12:16 PM
  5. SIMS Database & Log File
    By indiegirl in forum MIS Systems
    Replies: 14
    Last Post: 17th March 2006, 03:00 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •