Sponsored Content
Top Forums Shell Programming and Scripting Search a text and return the text from file Post 302951010 by RudiC on Friday 31st of July 2015 06:52:29 AM
Old 07-31-2015
Try
Code:
awk -vS1=$string1 -vS2=$string2 -vS4=$string4 -vS5=$string5 -F"\t" '
BEGIN                                   {MX1=MX3=-1E100
                                        }
$2 ~ "^" S1 " " S2 ".*" S4 " " S5 "$"   {if ($1 > MX1)  {MX1 = $1
                                                         T1  = $2
                                                        }
                                         if ($3 > MX3)  {MX3 = $3
                                                         T3  = $2
                                                        }
                                        }
END                                     {print T1
                                         print T3
                                        }
' file
hai wafam cherolna makha palli
hai wafam cherolduna makha palli

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

search and replace a specific text in text file?

I have a text file with following content (3 lines) filename : output.txt first line:12/12/2008 second line:12/12/2008 third line:Y I would like to know how we can replace 'Y' with 'N' in the 3rd line keeping 1st and 2nd lines same as what it was before. I tried using cat output.txt... (4 Replies)
Discussion started by: santosham
4 Replies

2. Shell Programming and Scripting

Search text from a file and print text and one previous line too

Hi, Please let me know how to find text and print text and its previous line. Please don't get irritated few days back I asked text and next line. I am using HP-UX 11.11 Thanks for your help. (6 Replies)
Discussion started by: kamranjalal
6 Replies

3. Shell Programming and Scripting

search text file in file if this file contains necessary text (awk,grep)

Hello friends! Help me pls to write correct awk and grep statements for my task: I have got files with name filename.txt It has such structure: Start of file FROM: address@domen.com (12...890) abc DATE: 11/23/2009 on Std SUBJECT: any subject End of file So, I must check, if this file... (4 Replies)
Discussion started by: candyme
4 Replies

4. Shell Programming and Scripting

Search value in text file

Hi, I have the follwoing text file : db1;unrecoverable;0;20110728162548 db1;unrefreshed;1,NO_MV_VIEWS;20110728162548 xe1;Database;1;20110728162548 xe1;autoextensible;0;20110511112053 xe1;chk_offline_dbf;0;20110511112053 xe1;expiry_date;0;20110511112053 xe1;job;4;20110420111823... (2 Replies)
Discussion started by: yoavbe
2 Replies

5. Shell Programming and Scripting

bash: need to have egrep to return a text string if the search pattern has NOT been found

Hello all, after spending hours of searching the web I decided to create an account here. This is my first post and I hope one of the experts can help. I need to resolve a grep / sed / xargs / awk problem. My input file is just like this: ----------------------------------... (6 Replies)
Discussion started by: bash4ever
6 Replies

6. UNIX for Dummies Questions & Answers

Search String, Out matched text and input text for no match.

I need to search a string for some specific text which is no big deal using grep. My problem is when the search fails to find the text. I need to add text like "na" when my search does not match. I have tried this command but it does not work when I put the command in a loop in a bash script: ... (12 Replies)
Discussion started by: jojojmac5
12 Replies

7. Shell Programming and Scripting

Match text from file 1 to file 2 and return specific text

I hope this makes sense and is possible. I am trying to match $1 of panel_genes.txt with $3 of RefSeqGene.txt and when a match is found the value in $6 of RefSeqGene.txt Example: ACTA2 is $1 of panel_genes.txt ACTA2 NM_001613.2 ACTA2 NM_001141945.1 awk 'FNR==NR {... (4 Replies)
Discussion started by: cmccabe
4 Replies

8. Shell Programming and Scripting

Read in search strings from text file, search for string in second text file and output to CSV

Hi guys, I have a text file named file1.txt that is formatted like this: 001 , ID , 20000 002 , Name , Brandon 003 , Phone_Number , 616-234-1999 004 , SSNumber , 234-23-234 005 , Model , Toyota 007 , Engine ,V8 008 , GPS , OFF and I have file2.txt formatted like this: ... (2 Replies)
Discussion started by: An0mander
2 Replies

9. Shell Programming and Scripting

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

hi all, trying this using shell/bash with sed/awk/grep I have two files, one containing one column, the other containing multiple columns (comma delimited). file1.txt abc12345 def12345 ghi54321 ... file2.txt abc1,text1,texta abc,text2,textb def123,text3,textc gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
DateTime::Locale::vi(3) 				User Contributed Perl Documentation				   DateTime::Locale::vi(3)

NAME
DateTime::Locale::vi SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'vi' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Vietnamese. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) ThX hai ThX ba ThX tX ThX nXm ThX sau ThX bXy ChX nhXt Abbreviated (format) Th 2 Th 3 Th 4 Th 5 Th 6 Th 7 CN Narrow (format) Th 2 Th 3 Th 4 Th 5 Th 6 Th 7 CN Wide (stand-alone) ThX hai ThX ba ThX tX ThX nXm ThX sau ThX bXy ChX nhXt Abbreviated (stand-alone) Th 2 Th 3 Th 4 Th 5 Th 6 Th 7 CN Narrow (stand-alone) 2 3 4 5 6 7 1 Months Wide (format) thang mXt thang hai thang ba thang tX thang nXm thang sau thang bXy thang tam thang chin thang mXXi thang mXXi mXt thang mXXi hai Abbreviated (format) thg 1 thg 2 thg 3 thg 4 thg 5 thg 6 thg 7 thg 8 thg 9 thg 10 thg 11 thg 12 Narrow (format) thg 1 thg 2 thg 3 thg 4 thg 5 thg 6 thg 7 thg 8 thg 9 thg 10 thg 11 thg 12 Wide (stand-alone) thang mXt thang hai thang ba thang tX thang nXm thang sau thang bXy thang tam thang chin thang mXXi thang mXXi mXt thang mXXi hai Abbreviated (stand-alone) thg 1 thg 2 thg 3 thg 4 thg 5 thg 6 thg 7 thg 8 thg 9 thg 10 thg 11 thg 12 Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Quarters Wide (format) Q1 Q2 Q3 Q4 Abbreviated (format) Q1 Q2 Q3 Q4 Narrow (format) 1 2 3 4 Wide (stand-alone) Q1 Q2 Q3 Q4 Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide BCE CE Abbreviated tr. CN sau CN Narrow tr. CN sau CN Date Formats Full 2008-02-05T18:30:30 = ThX ba, ngay 05 thang hai nXm 2008 1995-12-22T09:05:02 = ThX sau, ngay 22 thang mXXi hai nXm 1995 -0010-09-15T04:44:23 = ThX bXy, ngay 15 thang chin nXm -10 Long 2008-02-05T18:30:30 = Ngay 05 thang 2 nXm 2008 1995-12-22T09:05:02 = Ngay 22 thang 12 nXm 1995 -0010-09-15T04:44:23 = Ngay 15 thang 9 nXm -10 Medium 2008-02-05T18:30:30 = 05-02-2008 1995-12-22T09:05:02 = 22-12-1995 -0010-09-15T04:44:23 = 15-09--010 Short 2008-02-05T18:30:30 = 05/02/2008 1995-12-22T09:05:02 = 22/12/1995 -0010-09-15T04:44:23 = 15/09/-010 Default 2008-02-05T18:30:30 = 05-02-2008 1995-12-22T09:05:02 = 22-12-1995 -0010-09-15T04:44:23 = 15-09--010 Time Formats Full 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Short 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 Default 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Datetime Formats Full 2008-02-05T18:30:30 = 18:30:30 UTC ThX ba, ngay 05 thang hai nXm 2008 1995-12-22T09:05:02 = 09:05:02 UTC ThX sau, ngay 22 thang mXXi hai nXm 1995 -0010-09-15T04:44:23 = 04:44:23 UTC ThX bXy, ngay 15 thang chin nXm -10 Long 2008-02-05T18:30:30 = 18:30:30 UTC Ngay 05 thang 2 nXm 2008 1995-12-22T09:05:02 = 09:05:02 UTC Ngay 22 thang 12 nXm 1995 -0010-09-15T04:44:23 = 04:44:23 UTC Ngay 15 thang 9 nXm -10 Medium 2008-02-05T18:30:30 = 18:30:30 05-02-2008 1995-12-22T09:05:02 = 09:05:02 22-12-1995 -0010-09-15T04:44:23 = 04:44:23 15-09--010 Short 2008-02-05T18:30:30 = 18:30 05/02/2008 1995-12-22T09:05:02 = 09:05 22/12/1995 -0010-09-15T04:44:23 = 04:44 15/09/-010 Default 2008-02-05T18:30:30 = 18:30:30 05-02-2008 1995-12-22T09:05:02 = 09:05:02 22-12-1995 -0010-09-15T04:44:23 = 04:44:23 15-09--010 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 Th 3 1995-12-22T09:05:02 = 22 Th 6 -0010-09-15T04:44:23 = 15 Th 7 H (H) 2008-02-05T18:30:30 = 18 1995-12-22T09:05:02 = 9 -0010-09-15T04:44:23 = 4 HHmm (HH:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 HHmmss (HH:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 CH 1995-12-22T09:05:02 = 9:05 SA -0010-09-15T04:44:23 = 4:44 SA Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 CH 1995-12-22T09:05:02 = 9:05:02 SA -0010-09-15T04:44:23 = 4:44:23 SA M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (d-M) 2008-02-05T18:30:30 = 5-2 1995-12-22T09:05:02 = 22-12 -0010-09-15T04:44:23 = 15-9 MEd (E, d-M) 2008-02-05T18:30:30 = Th 3, 5-2 1995-12-22T09:05:02 = Th 6, 22-12 -0010-09-15T04:44:23 = Th 7, 15-9 MMdd (dd-MM) 2008-02-05T18:30:30 = 05-02 1995-12-22T09:05:02 = 22-12 -0010-09-15T04:44:23 = 15-09 MMM (LLL) 2008-02-05T18:30:30 = thg 2 1995-12-22T09:05:02 = thg 12 -0010-09-15T04:44:23 = thg 9 MMMd (d MMM) 2008-02-05T18:30:30 = 5 thg 2 1995-12-22T09:05:02 = 22 thg 12 -0010-09-15T04:44:23 = 15 thg 9 MMMEd (E d MMM) 2008-02-05T18:30:30 = Th 3 5 thg 2 1995-12-22T09:05:02 = Th 6 22 thg 12 -0010-09-15T04:44:23 = Th 7 15 thg 9 MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 thang hai 1995-12-22T09:05:02 = 22 thang mXXi hai -0010-09-15T04:44:23 = 15 thang chin MMMMEd (E d MMMM) 2008-02-05T18:30:30 = Th 3 5 thang hai 1995-12-22T09:05:02 = Th 6 22 thang mXXi hai -0010-09-15T04:44:23 = Th 7 15 thang chin mmss (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, d-M-yyyy) 2008-02-05T18:30:30 = Th 3, 5-2-2008 1995-12-22T09:05:02 = Th 6, 22-12-1995 -0010-09-15T04:44:23 = Th 7, 15-9--010 yMMM (MMM y) 2008-02-05T18:30:30 = thg 2 2008 1995-12-22T09:05:02 = thg 12 1995 -0010-09-15T04:44:23 = thg 9 -10 yMMMEd (EEE, d MMM y) 2008-02-05T18:30:30 = Th 3, 5 thg 2 2008 1995-12-22T09:05:02 = Th 6, 22 thg 12 1995 -0010-09-15T04:44:23 = Th 7, 15 thg 9 -10 yMMMM (MMMM y) 2008-02-05T18:30:30 = thang hai 2008 1995-12-22T09:05:02 = thang mXXi hai 1995 -0010-09-15T04:44:23 = thang chin -10 yQ (Q yyyy) 2008-02-05T18:30:30 = 1 2008 1995-12-22T09:05:02 = 4 1995 -0010-09-15T04:44:23 = 3 -010 yQQQ (QQQ y) 2008-02-05T18:30:30 = Q1 2008 1995-12-22T09:05:02 = Q4 1995 -0010-09-15T04:44:23 = Q3 -10 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyyy (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yyyyMM (MM-yyyy) 2008-02-05T18:30:30 = 02-2008 1995-12-22T09:05:02 = 12-1995 -0010-09-15T04:44:23 = 09--010 Miscellaneous Prefers 24 hour time? Yes Local first day of the week ThX hai SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.16.2 2013-08-25 DateTime::Locale::vi(3)
All times are GMT -4. The time now is 06:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy