![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help in splitting the file | Vaddadi | Shell Programming and Scripting | 3 | 05-23-2008 06:44 AM |
| File Splitting | dncs | Shell Programming and Scripting | 5 | 12-06-2007 04:47 AM |
| [Splitting file] Extracting group of segments from one file to others | ozgurgul | Shell Programming and Scripting | 1 | 09-14-2006 09:17 AM |
| File splitting | praveen.pinto | UNIX for Dummies Questions & Answers | 9 | 02-10-2005 01:32 PM |
| file splitting | praveen.pinto | UNIX for Advanced & Expert Users | 2 | 02-10-2005 06:54 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
splitting file
Dear All,
Here I need some help. I have a file which has 100 lines and I like to split that file into 5 files each containing 20 lines. so the wc -l bigfile gives me 100 lines. How I will make 5 small files out of this each containing exactly 20 lines: thanks. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
sounds like homework ... if not, check "man awk" or "man sed" ...
|
|
#3
|
|||
|
|||
|
The split command is what you want. try man split.
I agree it sounds like homework to me too. |
|
#4
|
|||
|
|||
|
Thanks
Guys,
thanks for all the help. It is not a home work although perfectly sounds that way. I have a long sql file which has many individual sql statements like analyze table (one liner). so what we want to do is to break the master script into 5 individual script so we could run 5 sqlplus sessions at a time. However it could be done with other way but this 5 sqlplus sessions is now the interest to my company. I used stuffs like you guys mentioned: both sed and split:for example: split -b1024b bigfile and it created a bunch of xxa xxb types which could be renamed to sql file and very well run without trouble. sed was useful too. thanks. |
|||
| Google The UNIX and Linux Forums |