![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help Needed : Split one big file to multiple files | monicasgupta | Shell Programming and Scripting | 5 | 03-03-2008 07:09 PM |
| split file depending on content | Chaitrali | Shell Programming and Scripting | 4 | 11-14-2007 09:15 AM |
| Split A File Into 2 Files | dummy_needhelp | Shell Programming and Scripting | 7 | 11-04-2007 07:36 PM |
| How can I rename multiple files depending on a string occuring in the filenames? | karman | UNIX for Dummies Questions & Answers | 6 | 05-22-2007 03:29 PM |
| Split a file into 2 or more files | bobo | UNIX for Dummies Questions & Answers | 4 | 01-16-2006 05:15 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Split file into multiple files depending upon first 4 digits
Hi All,
I have a file like below: 1016D"ddd","343","1299" 1016D"ddd","3564","1299" 1016D"ddd","3297","1393" 1016D"ddd","32989","1527" 1016D"ddd","346498","1652" 2312D"ddd","3269","1652" 2312D"ddd","328","1652" 2312D"ddd","2224","2100" 3444D"ddd","252","2100" 3444D"ddd","2619","2100" I need to split this big file (will contain lot of records like above) into multiple files depending upon the first 4 digits. The output files will be like: filename.1016.dat 1016D"ddd","343","1299" 1016D"ddd","3564","1299" 1016D"ddd","3297","1393" 1016D"ddd","32989","1527" 1016D"ddd","346498","1652" filename.2312.dat 2312D"ddd","3269","1652" 2312D"ddd","328","1652" 2312D"ddd","2224","2100" filename.3444.dat 3444D"ddd","252","2100" 3444D"ddd","2619","2100" I searched for some examples but they all are done using awk.. and as there is no field separator here I cant use awk.. Please help. Thanks D |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|