Search Results

Search: Posts Made By: quirkguy
18,601
Posted By Ygor
Try...$ seq 13 > infile $ awk...
Try...$ seq 13 > infile

$ awk '{a[NR]=$0}END{for(i=1;i<=NR;i++)print a[i] > "outfile" 1+int(n*((i-1)/NR))}' n=3 infile

$ head outfile*
==> outfile1 <==
1
2
3
4
5

==> outfile2 <==
6
7...
18,601
Posted By jayan_jay
Here "n" - number of users. In case the line...
Here "n" - number of users. In case the line count of infile is not exactly divisible by the number of users, then it ll create a new file with the remainder lines.
Try this ..

$ wc -l infile |...
18,601
Posted By jayan_jay
Change the value of "5" as per ur requirement ...
Change the value of "5" as per ur requirement

$ split -5 singlefile
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 01:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy