![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Split files using Csplit | savitha | UNIX for Dummies Questions & Answers | 7 | 12-01-2007 11:55 AM |
| Split A File Into 2 Files | dummy_needhelp | Shell Programming and Scripting | 7 | 11-04-2007 07:36 PM |
| total number of files which have "aaa" in files whose names are File*_bbb* | sudheshnaiyer | UNIX for Dummies Questions & Answers | 1 | 08-16-2007 03:34 PM |
| Split a file into 2 or more files | bobo | UNIX for Dummies Questions & Answers | 4 | 01-16-2006 05:15 PM |
| awk command to split in to 2 files | m_subra_mani | Shell Programming and Scripting | 3 | 12-13-2005 05:13 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
split files into specified number of output files
Hi everyone,
I have some large text files that I need to split into a specific number of files of equal size. As far as I know (and I don't really know that much ) the split command only lets you specify the number of lines or bytes. The files are all of a different size, so the number of lines differ as well.I use the following code to see how many lines each output file should be (1/50 of the original document): y=`wc | awk '{ print $x/50}' | awk -F. '{if($2>=1){print $1+1}else{print $1}}'` echo $y The problem is that I can't use this variable $y as input for the split command like this: split $x -d -l $y split/$x It simply doesn't work. Does anyone know a way to pass the value of the $y variable into the split command? Or does anyone have a better way of solving the entire problem? Thanks in advance! |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|