Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Closed Thread
  Search this Thread
Old 05-16-2011, 08:23 AM   #1
LQ Newbie
Registered: May 2011
Posts: 9

Rep: Reputation: 0
finding and remove block of identical strings

i have a problem in finding block of identical strings...i solved the problem in finding consecutive identical words and now i want to expand the code in order to find and remove consecutive identical block of strings...
for example the awk code removing consecutive identical word is:
#!/usr/bin/awk -f
  if(x != f[2])
    print y$0;z = FNR
  x = f[2];
  y = RT
  if(z != FNR)
  print f[3]"\n"
"ana are mere mere
mere si portocale
ion are prune prune."

"ana are mere si portocale
ion are prune."

and now i want to expand the code to do the following:
"ana are ana are mere
ion are prune ion are prune"

"ana are mere
ion are prune"


Last edited by cocostaec; 05-16-2011 at 11:00 AM. Reason: Added code tags to prevent emoticon recognition and parsing.
Old 05-16-2011, 08:52 AM   #2
LQ Guru
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,735

Rep: Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043
Please place code in [code][/code] tags as this is practically illegible.
Old 05-20-2011, 07:24 AM   #3
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread should be closed because it is a duplicate.

Pending closure by the mods assigned to this forum, please post all answers here:

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can not match strings that appear to be identical dnoob Programming 4 02-27-2011 12:42 PM
Grep -- finding files that contain two separate strings Fliggerty Linux - Newbie 4 12-10-2010 09:40 AM
block strings with pf. posible? what about other firewalls ? da1 *BSD 1 06-21-2007 09:29 AM
Is it possible to block text strings with IP tables? abefroman Linux - Security 27 06-29-2005 06:36 PM
remove identical lines in a file benjithegreat98 Linux - General 4 04-24-2004 07:12 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration