Quantcast
Channel: Commands using split
Viewing all articles
Browse latest Browse all 16

Split SQL/TXT File into 12000 Lines Each File and then Add .sql Extension to File

$
0
0
$ split -l 12000 -a 5 database.sql splited_file i=1 for file in splited_file* do mv $file database_${i}.sql i=$(( i + 1 )) done

For some reason split will not let you add extension to the files you split. Just add this to a .sh script and run with bash or sh and it will split your text file at 12000 lines for each file and then add a .sql extension to the file name.

commandlinefu.com

Diff your entire server config at ScriptRock.com


Viewing all articles
Browse latest Browse all 16

Trending Articles