comparison docs/scripts/txt/SplitTextFiles.txt @ 0:4816e4a8ae95 draft default tip

Uploaded
author deepakjadmin
date Wed, 20 Jan 2016 09:23:18 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4816e4a8ae95
1 NAME
2 SplitTextFiles.pl - Split CSV or TSV TextFile(s) into multiple text
3 files
4
5 SYNOPSIS
6 SplitTextFiles.pl TextFile(s)...
7
8 SplitTextFiles.pl [-f, --fast] [-h, --help] [--indelim comma |
9 semicolon] [-l, --label yes | no] [-n, --numfiles number] [-o,
10 --overwrite] [--outdelim comma | tab | semicolon] [-q, --quote yes | no]
11 [-r, --root rootname] [-w, --workingdir dirname] TextFile(s)...
12
13 DESCRIPTION
14 Split CSV or TSV *TextFile(s)* into multiple text files. Each new text
15 file contains a subset of similar number of lines from the initial file.
16 The file names are separated by space. The valid file extensions are
17 *.csv* and *.tsv* for comma/semicolon and tab delimited text files
18 respectively. All other file names are ignored. All the text files in a
19 current directory can be specified by **.csv*, **.tsv*, or the current
20 directory name. The --indelim option determines the format of
21 *TextFile(s)*. Any file which doesn't correspond to the format indicated
22 by --indelim option is ignored.
23
24 OPTIONS
25 -f, --fast
26 In this mode, --indelim, --outdelim, and -q --quote options are
27 ignored. The format of input and output file(s) are assumed to be
28 similar. And the text lines from input *TextFile(s)* are just
29 transferred to output file(s) without any processing.
30
31 -h, --help
32 Print this help message.
33
34 --indelim *comma | semicolon*
35 Input delimiter for CSV *TextFile(s)*. Possible values: *comma or
36 semicolon*. Default value: *comma*. For TSV files, this option is
37 ignored and *tab* is used as a delimiter.
38
39 -l, --label *yes | no*
40 First line contains column labels. Possible values: *yes or no*.
41 Default value: *yes*.
42
43 -n, --numfiles *number*
44 Number of new files to generate for each TextFile(s). Default: *2*.
45
46 -o, --overwrite
47 Overwrite existing files.
48
49 --outdelim *comma | tab | semicolon*
50 Output text file delimiter. Possible values: *comma, tab, or
51 semicolon*. Default value: *comma*
52
53 -q, --quote *yes | no*
54 Put quotes around column values in output text file. Possible
55 values: *yes or no*. Default value: *yes*.
56
57 -r, --root *rootname*
58 New text file names are generated using the root:
59 <Root>Part<Count>.<Ext>. Default new file names:
60 <InitialTextFileName>Part<Count>.<Ext>. The csv, and tsv <Ext>
61 values are used for comma/semicolon, and tab delimited text files
62 respectively.This option is ignored for multiple input files.
63
64 -w, --workingdir *dirname*
65 Location of working directory. Default: current directory.
66
67 EXAMPLES
68 To split each CSV text files into 4 different text files type:
69
70 % SplitTextFiles.pl -n 5 -o Sample1.csv Sample2.csv
71 % SplitTextFiles.pl -n 5 -o *.csv
72
73 To split Sample1.tsv into 10 different CSV text files, type:
74
75 % SplitTextFiles.pl -n 10 --outdelim comma -o Sample1.tsv
76
77 AUTHOR
78 Manish Sud <msud@san.rr.com>
79
80 SEE ALSO
81 JoinTextFiles.pl, MergeTextFiles.pl, ModifyTextFilesFormat.pl
82
83 COPYRIGHT
84 Copyright (C) 2015 Manish Sud. All rights reserved.
85
86 This file is part of MayaChemTools.
87
88 MayaChemTools is free software; you can redistribute it and/or modify it
89 under the terms of the GNU Lesser General Public License as published by
90 the Free Software Foundation; either version 3 of the License, or (at
91 your option) any later version.
92