Sponsored Content
Full Discussion: grep for a word
Top Forums Shell Programming and Scripting grep for a word Post 302598681 by Siddheshk on Wednesday 15th of February 2012 06:09:57 AM
Old 02-15-2012
Thanks,

again it give me below output.

Code:
SAMSUNG-GT-B5310/B5310DDIK5 SHP/VPP/R5 Dolfin/1.5 Nextreaming SMM-MMS/1.2.0 profile/MIDP-2.1 configuration/CLDC-1.1
SAMSUNG-GT-C3303i/C3303iDDKB2
SAMSUNG-GT-C3200/1.0 NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1
job1
SAMSUNG-GT-C3200/1.0 NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1
job1

i want list of only first word. i.e. SAMSUNG-GT-xxxx/

-Siddhesh
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to grep for a word and display only the word

Hi, When we "grep" for a word in a file, it returns the lines containing the word that we searched for. Is there a way to display only the words and not the entire line containing them. Thanks Ananth (6 Replies)
Discussion started by: ananthmm
6 Replies

2. UNIX for Dummies Questions & Answers

how to grep the word and display only the second word from it

hi, consider the below line in a text file, 'Y',getdate(),'N','V',NULL ..... 'N',getdate(),'Y','D',NULL ..... 'Y','N','Y',getdate(),'Y','D',NULL .... as u see above, i want only the second word after the getdate() word... getdate() will not come 2nd word alwys it may be any position but i... (11 Replies)
Discussion started by: prsam
11 Replies

3. Shell Programming and Scripting

Grep out specific word and only that word

ok, so this is proving to be kind of difficult even though it should not be. say for instance I want to grep out ONLY the word fkafal from the below output, how do I do it? echo ajfjf fjfjf iafjga fkafal foeref afoafahfia | grep -w "fkafal" If i run the above command, i get back all the... (4 Replies)
Discussion started by: SkySmart
4 Replies

4. Shell Programming and Scripting

Grep for a particular word and get only the word

HI, Let us a consider i have a file as following. abcde (flag5 / 234 ) Mod 45 efgh afghd (flag3/ 343) MOD 34 ghdd tryd (t_flag6/ 567 ) MOD 43 uifudiu Is there a way where I need only the flag and the calculation done on it. The output should be : (flag5 / 234 ) Mod 45 ... (8 Replies)
Discussion started by: ashwin3086
8 Replies

5. Shell Programming and Scripting

How to grep a word and next column to that word?

Hi, I have input file as below. Can you help me? inac_4y;0;2;Balance;200;1;1; 0;2;Balance;100;1; 0;inac_nq;0;1;Balance;100;1 desired output Balance;200 Balance;100 Balance;100 -Suresh Please use and tags when posting code, data or logs etc. to preserve formatting... (5 Replies)
Discussion started by: suresh3566
5 Replies

6. Shell Programming and Scripting

grep part of word or Another word from a string

Hi all, FileOne family balance >>>>> 0 0 0 0 java.io.FileNotFoundException: Settings.xml (No such file or directory) at java.io.FileInputStream.open(Native Method) .. .... ..... ..... java.lang.NullPointerException ... ..... ...... Stacktrace: at... (2 Replies)
Discussion started by: linuxadmin
2 Replies

7. Shell Programming and Scripting

How ti Grep for a word and print the next word

Hi can we grep for a word and print the next word of the greped word? ex:- create or replace function function_name create function function_name we should search for word "function" and output next word "function_name" from both lines. (3 Replies)
Discussion started by: manasa_vs
3 Replies

8. Shell Programming and Scripting

Grep two word and one word with if

so far I have the following , it work, if grep -w "Hi"\|"Hello" /home/my.log 2>&1 > /dev/null then EMAIL_ADDR="aaa@gmail.com" echo "Please view the error messages on attached file " | mutt -a ~/error_report.txt -s "hi `date +"%d-%m-%Y"`" "$EMAIL_ADDR" fi But :(I want to add if... (6 Replies)
Discussion started by: Hscript
6 Replies

9. Shell Programming and Scripting

Need a word which just comes next to after grep of a specific word

Hi, Below is an example : ST1 PREF: int1 AVAIL: int2 ST2 PREF :int1 AVAIL: int2 I need int1 to come in preferred variable while programming and int2 in available variable Please help me doing so Best regards, Vishal (10 Replies)
Discussion started by: Vishal_dba
10 Replies

10. Shell Programming and Scripting

Grep for a word or word with underscore

I have a file "test" with following contents: cat test abc abcd_efg abc_abc I want to only grep for abc or abc_ without getting other results, how do I achieve this? If I use grep -w abc test option I get only abc and not abc_. If I use egrep "abc|abc_" test its still printing... (3 Replies)
Discussion started by: ctrld
3 Replies
DBI::ProfileDumper(3)					User Contributed Perl Documentation				     DBI::ProfileDumper(3)

NAME
DBI::ProfileDumper - profile DBI usage and output data to a file SYNOPSIS
To profile an existing program using DBI::ProfileDumper, set the DBI_PROFILE environment variable and run your program as usual. For example, using bash: DBI_PROFILE=2/DBI::ProfileDumper program.pl Then analyze the generated file (dbi.prof) with dbiprof: dbiprof You can also activate DBI::ProfileDumper from within your code: use DBI; # profile with default path (2) and output file (dbi.prof) $dbh->{Profile} = "!Statement/DBI::ProfileDumper"; # same thing, spelled out $dbh->{Profile} = "!Statement/DBI::ProfileDumper/File:dbi.prof"; # another way to say it use DBI::ProfileDumper; $dbh->{Profile} = DBI::ProfileDumper->new( Path => [ '!Statement' ], File => 'dbi.prof' ); # using a custom path $dbh->{Profile} = DBI::ProfileDumper->new( Path => [ "foo", "bar" ], File => 'dbi.prof', ); DESCRIPTION
DBI::ProfileDumper is a subclass of DBI::Profile which dumps profile data to disk instead of printing a summary to your screen. You can then use dbiprof to analyze the data in a number of interesting ways, or you can roll your own analysis using DBI::ProfileData. NOTE: For Apache/mod_perl applications, use DBI::ProfileDumper::Apache. USAGE
One way to use this module is just to enable it in your $dbh: $dbh->{Profile} = "1/DBI::ProfileDumper"; This will write out profile data by statement into a file called dbi.prof. If you want to modify either of these properties, you can construct the DBI::ProfileDumper object yourself: use DBI::ProfileDumper; $dbh->{Profile} = DBI::ProfileDumper->new( Path => [ '!Statement' ], File => 'dbi.prof' ); The "Path" option takes the same values as in DBI::Profile. The "File" option gives the name of the file where results will be collected. If it already exists it will be overwritten. You can also activate this module by setting the DBI_PROFILE environment variable: $ENV{DBI_PROFILE} = "!Statement/DBI::ProfileDumper"; This will cause all DBI handles to share the same profiling object. METHODS
The following methods are available to be called using the profile object. You can get access to the profile object from the Profile key in any DBI handle: my $profile = $dbh->{Profile}; flush_to_disk $profile->flush_to_disk() Flushes all collected profile data to disk and empties the Data hash. Returns the filename written to. If no profile data has been collected then the file is not written and flush_to_disk() returns undef. The file is locked while it's being written. A process 'consuming' the files while they're being written to, should rename the file first, then lock it, then read it, then close and delete it. The "DeleteFiles" option to DBI::ProfileData does the right thing. This method may be called multiple times during a program run. empty $profile->empty() Clears the Data hash without writing to disk. filename $filename = $profile->filename(); Get or set the filename. The filename can be specified as a CODE reference, in which case the referenced code should return the filename to be used. The code will be called with the profile object as its first argument. DATA FORMAT
The data format written by DBI::ProfileDumper starts with a header containing the version number of the module used to generate it. Then a block of variable declarations describes the profile. After two newlines, the profile data forms the body of the file. For example: DBI::ProfileDumper 2.003762 Path = [ '!Statement', '!MethodName' ] Program = t/42profile_data.t + 1 SELECT name FROM users WHERE id = ? + 2 prepare = 1 0.0312958955764771 0.000490069389343262 0.000176072120666504 0.00140702724456787 1023115819.83019 1023115819.86576 + 2 execute 1 0.0312958955764771 0.000490069389343262 0.000176072120666504 0.00140702724456787 1023115819.83019 1023115819.86576 + 2 fetchrow_hashref = 1 0.0312958955764771 0.000490069389343262 0.000176072120666504 0.00140702724456787 1023115819.83019 1023115819.86576 + 1 UPDATE users SET name = ? WHERE id = ? + 2 prepare = 1 0.0312958955764771 0.000490069389343262 0.000176072120666504 0.00140702724456787 1023115819.83019 1023115819.86576 + 2 execute = 1 0.0312958955764771 0.000490069389343262 0.000176072120666504 0.00140702724456787 1023115819.83019 1023115819.86576 The lines beginning with "+" signs signify keys. The number after the "+" sign shows the nesting level of the key. Lines beginning with "=" are the actual profile data, in the same order as in DBI::Profile. Note that the same path may be present multiple times in the data file since "format()" may be called more than once. When read by DBI::ProfileData the data points will be merged to produce a single data set for each distinct path. The key strings are transformed in three ways. First, all backslashes are doubled. Then all newlines and carriage-returns are transformed into " " and " " respectively. Finally, any NULL bytes ("") are entirely removed. When DBI::ProfileData reads the file the first two transformations will be reversed, but NULL bytes will not be restored. AUTHOR
Sam Tregar <sam@tregar.com> COPYRIGHT AND LICENSE
Copyright (C) 2002 Sam Tregar This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself. perl v5.18.2 2013-06-24 DBI::ProfileDumper(3)
All times are GMT -4. The time now is 02:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy