-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdismemberFile.sh
More file actions
23 lines (18 loc) · 854 Bytes
/
Copy pathdismemberFile.sh
File metadata and controls
23 lines (18 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
<<commentBlock
Description:
Convert Millions of records/lines into manageble chunks of tens of thousends, or any albitrary number your heart desiers, by using this simple scipt to choose the csv file, and the input the number of lines each output file should have. The file is created in the same folder the target file is in.
Example:
Big Company file with 100,000 lines is broken down to 10 files, each with 10,000 lines.
commentBlock
split -l 20 file.txt new
# Functions
function requestPath(){
echo "Input a path relative path to the current directory [$DEFAULT_DIR], or leave empty to keep the current directory as the target to be organized."
read -p "Target CSV file name: " targetFile
read -p "Number of Row per file: " fileRows
}
#Script
requestPath
split -l $fileRows $targetFile dinmemberedFile/$targetFile/new
exit