![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| c program to extract text between two delimiters from some text file | kukretiabhi13 | High Level Programming | 7 | 12-03-2008 06:29 PM |
| Split large file and add header and footer to each file | ashish4422 | Shell Programming and Scripting | 1 | 04-15-2008 06:12 AM |
| Split a file with no pattern -- Split, Csplit, Awk | madhunk | UNIX for Dummies Questions & Answers | 10 | 12-17-2007 12:57 PM |
| grep multiple text files in folder into 1 text file? | coppertone | UNIX for Dummies Questions & Answers | 7 | 08-23-2002 02:50 PM |
| Split text file by pages | ranri | UNIX for Dummies Questions & Answers | 2 | 06-01-2001 02:43 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
efficiently split a 2GB text file into two
Can an expert kindly write an efficient Linux ksh script that will split a large 2 GB text file into two?
Here is a couple of sample record from that text file: "field1","field2","field3",11,22,33,44 "TG","field2b","field3b",1,2,3,4 The above rows are delimited by commas. This script is to search the first field for the word "TG". If that row is present, it is to load that row to a TG.txt file. If this first field is not "TG", then it is to load that row into a NoTG.txt file. So the result is a new TG.txt with the following row: "TG","field2b","field3b",1,2,3,4 and a new NoTG.txt with the following row: "field1","field2","field3",11,22,33,44 Thanks in advance. This forum rocks - with lots of helpful heroes!! ![]() |
|
||||
|
Thanks a million!!
Thanks a million!! That was so simple and elegant. So sorry to take up time from your busy schedule. I do pay back by answering questions in other VBA/ Essbase forums where I have greater expertise.
Pushing my luck with one last question: Can you expand on this KSH (kshell) script to exclude rows that have blanks instead of numbers? For example, exclude rows looking like this: "TG","field2c","field3c",,,, "TG","field2b","field3b",,,, where the last four fields are blanks. Thanks in advance. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|