Register for your free account! | Forgot your password?

You last visited: Today at 11:08

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[RELEASE] srFileMerge

Discussion on [RELEASE] srFileMerge within the SRO PServer Guides & Releases forum part of the SRO Private Server category.

Reply
 
Old   #1
 
Syloxx's Avatar
 
elite*gold: 56
Join Date: Oct 2013
Posts: 1,165
Received Thanks: 774
[RELEASE] srFileMerge

Hello Community,

I`ve just developed a little application that is able to merge text files (for example textuisystem_100.txt - textuisystem_99900) into a single file.

a few years ago Joymax decided to split these text files up probably to reduce traffic during update processes however our client's doesn't support that.

srFileMerge doesn't have a custom split interval added yet (for example to use ItemData) but since I include the source feel free to add it

HOW TO USE:
copy all related txt files into the input folder, execute srFileMerge and enter the "main" filename (for example textuisystem.txt)

SRC:
Code:
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace srFileMerge
{
    internal class Program
    {
        private static void Main()
        {
            CreateDirectories(new[] {"./input", "./output"});
            var fileName = GetFileName();

            MergeFiles(GetFileList(fileName), fileName);

            Console.WriteLine("PRESS ANY KEY TO EXIT!");
            Console.ReadKey();
        }

        private static void CreateDirectories(IEnumerable<string> directories)
        {
            try
            {
                foreach (var directory in directories)
                    if (!Directory.Exists(directory))
                        Directory.CreateDirectory(directory);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }

        private static string GetFileName()
        {
            Console.Write("ENTER MAIN FILENAME: ");
            var fileName = Console.ReadLine();

            if (!File.Exists($"./input/{fileName}"))
            {
                Console.WriteLine("FILE DOES NOT EXISTS IN INPUT FOLDER, RETRY!");
                fileName = GetFileName();
            }

            return fileName;
        }

        private static string[] GetFileList(string fileName)
        {
            try
            {
                return File.ReadAllLines($"./input/{fileName}");
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }

        private static void MergeFiles(IEnumerable<string> fileList, string fileName)
        {
            try
            {
                var outputFile = new List<string>();

                foreach (var file in fileList) outputFile.AddRange(File.ReadAllLines($"./input/{file}"));

                File.WriteAllLines($"./output/{fileName.ToLower()}", outputFile, Encoding.Unicode);

                Console.WriteLine("FILE HAS BEEN SUCCESSFULLY MERGED!");
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
    }
}
Attached Files
File Type: rar srFileMerge.rar (2.9 KB, 127 views)
Syloxx is offline  
Thanks
8 Users
Old 10/30/2019, 07:59   #2
 
elite*gold: 0
Join Date: Apr 2016
Posts: 289
Received Thanks: 67
Thank's . But we can use simple command line (cmd or power shell) and use excel to arrange
Thank's anyway
hoangphan7 is offline  
Old 10/30/2019, 08:13   #3
 
Syloxx's Avatar
 
elite*gold: 56
Join Date: Oct 2013
Posts: 1,165
Received Thanks: 774
Quote:
Originally Posted by hoangphan7 View Post
Thank's . But we can use simple command line (cmd or power shell) and use excel to arrange
Thank's anyway
I know, the issue with copy /b *.txt is that it sorts the files by character and not by number for example

TEXT_100
TEXT_1000
TEXT_200
TEXT_2000

you can test that by using the dir command means the lines of the text files wont be accurate and if you wanna use the type command >> output file then there is a problem with unicode chars, the cmd can't display them so the output wont be accurate here aswell
Syloxx is offline  
Old 10/30/2019, 09:33   #4

 
XxGhostSpiriTxX's Avatar
 
elite*gold: 53
Join Date: Jul 2012
Posts: 541
Received Thanks: 190
Good thanks bro for shared
XxGhostSpiriTxX is offline  
Old 10/30/2019, 11:32   #5
 
elite*gold: 0
Join Date: Jul 2017
Posts: 43
Received Thanks: 8
Please make Video for install

Gesendet von meinem SM-A750FN mit Tapatalk
TechnicVreak is offline  
Old 10/30/2019, 11:58   #6
 
Syloxx's Avatar
 
elite*gold: 56
Join Date: Oct 2013
Posts: 1,165
Received Thanks: 774
Quote:
Originally Posted by TechnicVreak View Post
Please make Video for install

Gesendet von meinem SM-A750FN mit Tapatalk
Syloxx is offline  
Old 10/30/2019, 14:47   #7
 
elite*gold: 0
Join Date: Apr 2016
Posts: 289
Received Thanks: 67
Quote:
Originally Posted by Syloxx View Post
I know, the issue with copy /b *.txt is that it sorts the files by character and not by number for example

TEXT_100
TEXT_1000
TEXT_200
TEXT_2000

you can test that by using the dir command means the lines of the text files wont be accurate and if you wanna use the type command >> output file then there is a problem with unicode chars, the cmd can't display them so the output wont be accurate here aswell
Yes. This why we need Excel to arrange . And remove double line
hoangphan7 is offline  
Old 10/30/2019, 19:51   #8
 
elite*gold: 0
Join Date: Sep 2016
Posts: 235
Received Thanks: 155
using Command prompt: copy textuisystem_*.txt textuisystem.txt
will merge all, but thanks for the good release
VeRo! is offline  
Thanks
1 User
Old 10/31/2019, 01:26   #9

 
senua's Avatar
 
elite*gold: 36
Join Date: Aug 2017
Posts: 142
Received Thanks: 61
Its good to coding somethings, but you should do some research before coding some stuff that is maybe already existing.

You can use Filejoiner program. Its simply do eveything that you want to do.
senua is offline  
Old 11/03/2019, 02:47   #10
 
Syloxx's Avatar
 
elite*gold: 56
Join Date: Oct 2013
Posts: 1,165
Received Thanks: 774
Quote:
Originally Posted by senua View Post
Its good to coding somethings, but you should do some research before coding some stuff that is maybe already existing.

You can use Filejoiner program. Its simply do eveything that you want to do.
Hey, thanks for your opinion and i took note of that however 1st of all (a little tip for beginners) It is always good practice to develop tools your self and understand how things works... for example i am currently working on a little GUI based application and I`ve noticed that these textbox hints / watermarks are a lot more work then i thought and that there are multiple ways 2 solve it.. same of them are more and some are less effective specially if you are using a PasswordBox (WPF).

2nd the tool is specially developed with the silkroad textdata in mind, all you do is unpack all textdata files into the input folder, enter the "main" filename and its generated you don't have to pick files and recheck if everything is in the correct order

If you always code stuff that doesn't exists already then good luck becoming a good developer since everything has already been developed to a certain point

-Syloxx
Syloxx is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Release release release [GW-ARENA]
06/11/2013 - Flyff PServer Guides & Releases - 2 Replies
Entnommen!
[RELEASE]DibiaseEO[RELEASE]
08/10/2008 - EO PServer Hosting - 33 Replies
CLOSED, HOSTING ALPHA ONLINE
[RELEASE] LEISLERS HACK v1.0 PUBLIC [RELEASE]
07/08/2008 - WarRock Hacks, Bots, Cheats & Exploits - 3 Replies
OUTDATED/DETECTED Hab mal nen Hack von mir Gemacht Screen http://www.abload.de/img/hackerhacker567.jpg DOWNLOAD :
[Release]Quick tools v2[Release]
04/01/2008 - MapleStory - 1 Replies
Newest version is out and ready for action! Updates: ~ Completely coded in vb6! New Pic: http://img257.imageshack.us/img257/3329/newhr0.jpg NOTE: You need microsoft frame network to run this, im not really positive where to get it...sorry :P. Just google it and you should be able to find the download.



All times are GMT +1. The time now is 11:08.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.