![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to remove duplicate records with out sort | svenkatareddy | Shell Programming and Scripting | 19 | 06-11-2008 11:10 AM |
| How to remove duplicate records with out sort | svenkatareddy | SUN Solaris | 2 | 02-28-2008 04:38 AM |
| Duplicate records from oracle to text file. | shilendrajadon | UNIX for Advanced & Expert Users | 1 | 01-10-2008 07:21 AM |
| Remove all instances of duplicate records from the file | vukkusila | Shell Programming and Scripting | 3 | 12-12-2007 03:50 AM |
| How to extract duplicate records with associated header record | run_eim | UNIX for Dummies Questions & Answers | 17 | 01-16-2007 07:46 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Records Duplicate
Hi Everyone,
I have a flat file of 1000 unique records like following : For eg Andy,Flower,201-987-0000,12/23/01 Andrew,Smith,101-387-3400,11/12/01 Ani,Ross,401-757-8640,10/4/01 Rich,Finny,245-308-0000,2/27/06 Craig,Ford,842-094-8740,1/3/04 . . . . . . Now I want to duplicate each row 3 times. How shall I do ? Please advice |
| Forum Sponsor | ||
|
|
|
|||
|
Ganesh,
I'm sure that would be better solution that what I have below: --------------------------------------------------------- while true do read record if [ "$record" = "" ] then break fi echo $record >> ./outputfile echo $record >> ./outputfile echo $record >> ./outputfile done < ./inputfile ### if the file name has to be changed : rm ./inputfile mv outputfile inputfile -------------------------------------------------------------- |
| Thread Tools | |
| Display Modes | |
|
|