![]() |
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 |
| vi to remove lines in file | kjbaumann | UNIX for Dummies Questions & Answers | 2 | 03-13-2009 03:40 AM |
| How to remove the specific lines from file using perl | dipakg | Shell Programming and Scripting | 4 | 06-11-2008 02:45 AM |
| remove specific lines from flat file using perl | meghana | Shell Programming and Scripting | 12 | 02-12-2008 09:50 PM |
| remove lines from file | bluemoon1 | Shell Programming and Scripting | 9 | 11-09-2007 01:40 AM |
| how to remove specific lines from a file | bluemoon1 | Shell Programming and Scripting | 17 | 10-07-2007 10:40 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to remove the lines from file using perl
Can anyone tell me what could be the solution to following :
I have one .txt file which contains some seed information. This seed may appear multiple time in the file so what I want do is if this seed appears again in the file then that line should be removed. here is the contents of .txt file : 187 TAL_SPI_CORRECT_REQ_OUT seed : 894328066; 187 TAL_SPI_NO_OF_BYTES_OUT seed : 894328066; 30445 TAL_SPI_MASTER_NO_MORE_DATA_OUT seed : 894328066; 352 TAL_SPI_MASTER_APPLY_COMMAND_OUT seed : 894328066; 944 TAL_SPI_MASTER_DATA_OUT seed : 894328066; 935 TAL_SPI_MASTER_ADDR_OUT seed : 894328066; 1 a_dsync100_no_wr_dsync_ucode_exec_nike seed : 1072076501; 1 a_dsync100_no_wr_dsync_ucode_exec_ath1 seed : 1805353229; 1 a_dsync100_no_wr_dsync_ucode_exec_ath0 seed : 1805353229; 1 a_dsync100_no_wr_dsync_ucode_exec_capt seed : 1805353229; 2 a_dsync_lcm_xm2_output seed : 894328066; 1 a_dsync_pulse_gen_to_rcsdi_clkgen seed : 894328066; 1 a_dsyncEnWrite_to_rcsdi_clkgen seed : 894328066; 3 a_extsynth_buf_en_ch1 seed : 1072076501; 3 a_extsynth_buf_en_ch0 seed : 1072076501; 3 a_extTrig2_width_ch1 seed : 1617187839; 2 a_extTrig1_width_ch1 seed : 1617187839; So once seed : 894328066 appears in the file, the script should remove the line if it appears twice and so on. Please help me ASAP. Regards and Thanks, Dipakg ![]() |
|
||||
|
How to remove the lines from file using perl
Hi radoulov,
Thanks for your reply it worked but after some time it goes wrong or may be it worked wrong way... What I did is perl -ane'print unless $_{$F[-1]}++' YES.txt As I manually does the analysis to find the seeds I get the result 71 seeds but by this command it gives only 21. How is this possible I don't know. Can you please figure it out? Regards, Dipak |
|
||||
|
How to remove the lines from file using perl
Here in I am attaching the text file.
For better view you can open it in wordpad. Now this text file should give me total 71 seeds as output(I mean total 71 lines should be appear as output). Last edited by dipakg; 06-03-2008 at 07:10 AM.. |
![]() |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|