The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
get rid of special characters vakharia Mahesh UNIX and Linux Applications 4 07-29-2008 02:36 PM
nawk-how count the number of occurances of a pattern, when don't know the pattern cyber111 Shell Programming and Scripting 2 05-11-2008 04:00 AM
special characters nawnaw UNIX for Dummies Questions & Answers 2 05-18-2004 04:17 PM
Changing Special Characters Using Sed cstovall Shell Programming and Scripting 4 09-15-2003 07:25 PM
awk/sed with special characters apalex Shell Programming and Scripting 5 05-06-2002 05:40 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-03-2009
danmauer danmauer is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 42
NAWK - seach pattern for special characters - } dbl qt - sng qt

i'm puzzled....

trying to look for the pattern }"'. but the below code returns to me the message below (pattern is curley queue + dbl qt + sng qt + period)

Quote:
awk: 0602-592 String }"'. cannot contain a newline character. The source line is 1.

Code:
  
nawk -v pat="\}\"\'\."'
          {
            if (match($0, pat)) {
               before = substr($0,1,RSTART-1);
                 do {
                     pattern = substr($0,RSTART,RLENGTH);
                     printf("%s%s\n", before, pattern);
                     $0=substr($0, RSTART+RLENGTH)
                    } while (match($0, pat))
                 }
          }' $HOME/TEMP/X1.dat >> $HOME/TEMP/X2.dat
Quote:
Thank you in advance for your help!
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:21 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0