Giter Site home page Giter Site logo

qdai-korewireless / file-splitter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dubasdey/file-splitter

0.0 2.0 0.0 118 KB

File splitter tool. Split files by size or number of lines.

License: GNU General Public License v3.0

C# 99.44% Batchfile 0.56%

file-splitter's Introduction

File-Splitter


Download File Splitter LGPLv3 Build Status

Information


A Windows and Console based utility to split large files into smaller parts.

Both the Windows and console versions share the same core library of code. Both versions are independent of each other (ie the Window version does not to gather all the parameters and then pass them to the batch program).

The split files retain the original extension if not custom format is used.
The current part number and the total partnumbers are inserted in the format "_XX(YY)", where XX is the current part number, and YY is the total number of parts. This format can be changed by parameter.

example: splitting console.log into 3 parts generates

console_1(3).log
console_2(3).log
console_3(3).log

How To Use


Split

Command line usage:

fsplit -split <size> <unit> <filePath> [-d] [-f <format>] [-df <folder>] [-lf <file>]"

Parameters:

  • -split
    • Splits the File into parts with this options
      • size
        • Size of parts in "unit"
      • unit
        • unit used for the desired size. Units:
          • 'b' bytes
          • 'kb' Kilobytes
          • 'mb' Megabytes
          • 'gb' Gigabytes
          • 'l' number of lines
      • filePath
        • Path of file to be split ex: "C:\console\console.log"
    • -d
      • Delete the original file after the split is done correctly.
    • -f
      • Uses a custom format for the files. Using a custom format is required to add an extension The text {0} is replaced with the current part number.
        The text {1} is replaced with the total number of parts expected.
        The format inputs accepts parameters to adapt it to the desired funcionality.
        For you could specify a padding of n possitions adding ,n.
        Example of 5 chars padding {0,5} with right align or {0,-5} to left align.
        Also you could specify a numeric filling usin # and 0 after :
        Examples for the file number 15:
        Filling with five 0: {0:00000} this result in '00015'.
        Filling with two and two 0 with - : {0:00-00} this result in '00-15'.
        Filling with three 0 in six positions aligned left {0,6:000} this result in '015 '
    • -df
      • Changes the result folder from current folder to the desired folder. The folder is created if not exists.
    • -lf
      • Creates a file with the names of all the generated files

Example:

fSplit -split 10230 kb c:\console\console.log   
  • Note 1: you can't use commas as delimiters
  • Note 2: if you call the program from the console without parameters, it invokes the Windows version.

Join

It's possible to merge again the files using the command line with the "copy" command
For example if you have splitted a text file into two parts "p1.txt" and "p2.txt" with "copy /A p1.txt+p2.txt all.txt" it's possible to merge p1 and p2 in a new file called all.txt
If the files are ASCII use /A flag and if the files are binary use the /B flag to ensure that the content is correctly joined.
Take careful to put all files in the correct order.

Donate


Buy me a coffe to help me continue supporting this project. Buy me a coffe

file-splitter's People

Contributors

dubasdey avatar

Watchers

James Cloos avatar Quan Dai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.