annotate docs/scripts/txt/SplitTextFiles.txt @ 3:90ea638ce878 draft default tip

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