Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with search strings

Status
Not open for further replies.

rogers42

Technical User
Mar 30, 2007
64
CA
Hi,

Given the string 2345", what is the correct syntax to locate '"' using the index() or the match() built-in functions ?

Thanks in advance.

rogers42

 
Use the escape character: \"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

Use:

index() to locate a substring within a string

match() to match a regular expression within a string

[3eyes]

PS: You need the escape character \" as posted by PHV to locate the double quote.


----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Worked like a charm.

Thanks for the help

rogers42
 
If the object is to remove " try...
echo "2345\""| awk '{print substr($0,1,index($0,"\"")-1)}'

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top