12-04-2009
Search for exact string
Hi All,
I need to search in a csv file as mentioend in the Appendix A for a exact word lets "TEST".
But using teh below command iam getting TEST1234, TEST12 and otehr entries as well.
the problem is i check this condition to check to add a record to a table by making sure it does not exits. But since it reurns TEST1234, i am not able to ad the record in Table.
is_there=$(awk -F ',' '{print$1}' test.dat | grep "TEST" )
Can you please a command preferable awk , which could search for the exact patterm.
Thanks a lot in anticpation.
Appendix A:
"TEST1234", " test desc"
"TEST12", " test desc"
"TABC123", " test desc"
"TBC", " test desc"
"12345", " test desc"
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, Can you help please.
I have the following comand:
if ]; then
l_valid_string="Y"
fi
The problem I am trying to solve is that my l_string = ABC and my file contains
ABC
ABC_EFG
I only want back the value ABC exact match. (3 Replies)
Discussion started by: CAGIRL
3 Replies
2. UNIX for Dummies Questions & Answers
Hi All,
I have 2 programs running by the following names:
a_testloop.sh
testloop.sh
I read these programs names from a file and store each of them into a variable called $program.
On the completion of the above programs i should send an email.
When i use grep with ps to see if any of... (3 Replies)
Discussion started by: albertashish
3 Replies
3. Shell Programming and Scripting
I am trying to match a pattern exactly in a shell script. I have tried two methods
awk '/\<mpath${CURR_MP}\>/{print $1 $2}' multipath
perl -ne '/\bmpath${CURR_MP}\b/ and print' /var/tmp/multipath
Both these methods require that I use the escape character. I am guessing that is why... (8 Replies)
Discussion started by: bash_in_my_head
8 Replies
4. UNIX for Advanced & Expert Users
Is there hopefully a way to search for an exact string in Man Pages? I know if I want to search for anything containing -c I can just do this.
/-c
How would I search for "-c"? I want only "-c" to show up. So I tried this.
/"-c"
It took me literally and looked for the quotes also. (13 Replies)
Discussion started by: cokedude
13 Replies
5. Shell Programming and Scripting
Hello Everyone,
Im trying to run a search and replace of exact strings and the strings that im using variables that are passed through an array in a while loop. Here is a snip of my code:
USEROLD=`cat oldusers`
USERNEW=`cat newusers`
USEROLDARRAY=( $USEROLD )
USERNEWARRAY=( $USERNEW )... (4 Replies)
Discussion started by: skizim
4 Replies
6. Shell Programming and Scripting
I have a file
DS1
DDS
DS
I want to replace only "DS" to "DSmail.blah.com" in a lot of files. I tried
sed 's/DS/DSmail.blah.com' but it changes all the lines .
thanks in advance (2 Replies)
Discussion started by: gubbu
2 Replies
7. Shell Programming and Scripting
QUESTION1:
How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed.
Contents of car.txt
CAR1_KEY0
CAR1_KEY1
CAR2_KEY0
CAR2_KEY1
CAR1_KEY10
CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1
grep... (1 Reply)
Discussion started by: thibodc
1 Replies
8. Shell Programming and Scripting
I am attempting to grep an exact string from a series of files within a directory and append that output to the filename when it is present in the file. I've been after this all day with no luck. Thanks for your help in advance :wall:. (4 Replies)
Discussion started by: JC_1
4 Replies
9. Shell Programming and Scripting
I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios.
Cat test
Nov 10, 2012 5:17:53 AM
INFO: Request Type
Line 1.... (5 Replies)
Discussion started by: laknar
5 Replies
10. Shell Programming and Scripting
Hi,
Need your help for this scripting issue I have. I am not really good at this, so seeking your help.
I have a file looking similar to this:
Hello, i am human and name=ABCD.
How are you?
Hello, i am human and name=PQRS.
I am good.
Hello, i am human and name=ABCD.
Good bye.
Hello, i... (12 Replies)
Discussion started by: royzlife
12 Replies
LEARN ABOUT SUSE
pango::fontdescription
Pango::FontDescription(3) User Contributed Perl Documentation Pango::FontDescription(3)
NAME
Pango::FontDescription
HIERARCHY
Glib::Boxed
+----Pango::FontDescription
METHODS
fontdescription = Pango::FontDescription->new
double = Pango->PANGO_PIXELS ($d)
o $d (double)
$desc->set_absolute_size ($size)
o $size (double)
Since: pango 1.8
boolean = $desc->better_match ($old_match, $new_match)
o $old_match (Pango::FontDescription or undef)
o $new_match (Pango::FontDescription)
boolean = $desc1->equal ($desc2)
o $desc2 (Pango::FontDescription)
string = $desc->get_family
$desc->set_family ($family)
o $family (string)
$desc->set_family_static ($family)
o $family (string)
fontdescription = Pango::FontDescription->from_string ($str)
o $str (string)
gravity = $desc->get_gravity
Since: pango 1.16
$desc->set_gravity ($gravity)
o $gravity (Pango::Gravity)
Since: pango 1.16
integer = $desc->hash
$desc->merge ($desc_to_merge, $replace_existing)
o $desc_to_merge (Pango::FontDescription)
o $replace_existing (boolean)
$desc->merge_static ($desc_to_merge, $replace_existing)
o $desc_to_merge (Pango::FontDescription)
o $replace_existing (boolean)
double = Pango->pixels ($d)
o $d (double)
double = Pango->scale
double = Pango->scale_large
double = Pango->scale_medium
double = Pango->scale_small
double = Pango->scale_x_large
double = Pango->scale_x_small
double = Pango->scale_xx_large
double = Pango->scale_xx_small
fontmask = $desc->get_set_fields
integer = $desc->get_size
boolean = $desc->get_size_is_absolute
Since: pango 1.8
$desc->set_size ($size)
o $size (integer)
stretch = $desc->get_stretch
$desc->set_stretch ($stretch)
o $stretch (Pango::Stretch)
style = $desc->get_style
$desc->set_style ($style)
o $style (Pango::Style)
string = $desc->to_filename
string = $desc->to_string
$desc->unset_fields ($to_unset)
o $to_unset (Pango::FontMask)
variant = $desc->get_variant
$desc->set_variant ($variant)
o $variant (Pango::Variant)
weight = $desc->get_weight
$desc->set_weight ($weight)
o $weight (Pango::Weight)
ENUMS AND FLAGS
flags Pango::FontMask
o 'family' / 'PANGO_FONT_MASK_FAMILY'
o 'style' / 'PANGO_FONT_MASK_STYLE'
o 'variant' / 'PANGO_FONT_MASK_VARIANT'
o 'weight' / 'PANGO_FONT_MASK_WEIGHT'
o 'stretch' / 'PANGO_FONT_MASK_STRETCH'
o 'size' / 'PANGO_FONT_MASK_SIZE'
o 'gravity' / 'PANGO_FONT_MASK_GRAVITY'
enum Pango::Gravity
o 'south' / 'PANGO_GRAVITY_SOUTH'
o 'east' / 'PANGO_GRAVITY_EAST'
o 'north' / 'PANGO_GRAVITY_NORTH'
o 'west' / 'PANGO_GRAVITY_WEST'
o 'auto' / 'PANGO_GRAVITY_AUTO'
enum Pango::Stretch
o 'ultra-condensed' / 'PANGO_STRETCH_ULTRA_CONDENSED'
o 'extra-condensed' / 'PANGO_STRETCH_EXTRA_CONDENSED'
o 'condensed' / 'PANGO_STRETCH_CONDENSED'
o 'semi-condensed' / 'PANGO_STRETCH_SEMI_CONDENSED'
o 'normal' / 'PANGO_STRETCH_NORMAL'
o 'semi-expanded' / 'PANGO_STRETCH_SEMI_EXPANDED'
o 'expanded' / 'PANGO_STRETCH_EXPANDED'
o 'extra-expanded' / 'PANGO_STRETCH_EXTRA_EXPANDED'
o 'ultra-expanded' / 'PANGO_STRETCH_ULTRA_EXPANDED'
enum Pango::Style
o 'normal' / 'PANGO_STYLE_NORMAL'
o 'oblique' / 'PANGO_STYLE_OBLIQUE'
o 'italic' / 'PANGO_STYLE_ITALIC'
enum Pango::Variant
o 'normal' / 'PANGO_VARIANT_NORMAL'
o 'small-caps' / 'PANGO_VARIANT_SMALL_CAPS'
enum Pango::Weight
o 'thin' / 'PANGO_WEIGHT_THIN'
o 'ultralight' / 'PANGO_WEIGHT_ULTRALIGHT'
o 'light' / 'PANGO_WEIGHT_LIGHT'
o 'book' / 'PANGO_WEIGHT_BOOK'
o 'normal' / 'PANGO_WEIGHT_NORMAL'
o 'medium' / 'PANGO_WEIGHT_MEDIUM'
o 'semibold' / 'PANGO_WEIGHT_SEMIBOLD'
o 'bold' / 'PANGO_WEIGHT_BOLD'
o 'ultrabold' / 'PANGO_WEIGHT_ULTRABOLD'
o 'heavy' / 'PANGO_WEIGHT_HEAVY'
o 'ultraheavy' / 'PANGO_WEIGHT_ULTRAHEAVY'
SEE ALSO
Pango, Glib::Boxed
COPYRIGHT
Copyright (C) 2003-2009 by the gtk2-perl team.
This software is licensed under the LGPL. See Pango for a full notice.
perl v5.12.1 2010-07-05 Pango::FontDescription(3)