Sponsored Content
Top Forums Shell Programming and Scripting Script to select the rows from the feed file based on the input value provided Post 302893970 by punpun66 on Saturday 22nd of March 2014 01:38:56 PM
Old 03-22-2014
Wrench Script to select the rows from the feed file based on the input value provided

Hi Folks,


I have the below feed file named abc1.txt in which you can see there is a title and below is the respective values in the rows and it is completely pipe delimited file ,.

Code:
ABC_ID|AMOUNT|ABC_DATE|ABC_CODE|ABD_ID|ABDE_ID|ABEFF_DATE|ABAL_AMOUNT|ab_ON|AB_ODE|TY_CODE|RITY_TE|CR_OKER|SYS_FLAG|CRT_MENT|ADM_ID|ERG_ID|ASH_ADE
0|0.00|24-Jun-14|SSRD|1677|82588|20-Mar-14|100004.00|0|Serest|TRRS|24-Mar-19||true|Receive|861|0|3862880
1|0.00|24-Sep-14|SRSD|1477|85288|20-Mar-14|100003.00|0|Serest|TYRS|24-Mar-19||true|Receive|831|0|3828680
2|0.00|24-Dec-14|HHSD|1777|82858|20-Mar-14|100006.00|0|Serest|UIRS|24-Mar-19||true|Receive|811|0|3862880
2|0.00|24-Dec-14|ESJD|1877|82885|20-Mar-14|100009.00|0|Serest|OPRS|24-Mar-19||true|Receive|861|0|3682880



now this feed files is been generated regularly by a process and is being kept at unix box at the following location /usr/cft/str so finally the file is at /usr/cft/str/abc1.txt
now from the right side you can see there is a column named ADM_ID , so can you please advise the script which will take ADM_ID as input from me
for example as per above feed file i can pass the ADM_ID as 861 from me , then that script will select all the rows where ADM_ID value is 861 (as rite now in the above sample there are
total 2 rows where ADM_ID value is 861) and then will put these two rows in the separate text file , so in this process a new file is created at the same location (/usr/cft/str)
and the name of the file is ADM_861 and this file will contain all the rows where ADM_ID value is 861 please advise the script for this, Thanks in advance Smilie


so finally the new file created by script at the same location named ADM_861 Wwill look like this..
Code:
0|0.00|24-Jun-14|SSRD|1677|82588|20-Mar-14|100004.00|0|Serest|TRRS|24-Mar-19||true|Receive|861|0|3862880
2|0.00|24-Dec-14|ESJD|1877|82885|20-Mar-14|100009.00|0|Serest|OPRS|24-Mar-19||true|Receive|861|0|3682880

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

select datas from an input file

I have a file containing a list of references and I want to run a script that will make the same action for each reference. The input file changes every hour, it's why I want to use a script that can read in a file, record by record, and run a specific action for the reference readed. Thanks... (1 Reply)
Discussion started by: dde
1 Replies

2. Shell Programming and Scripting

awk to select rows based on condition on column

I have got a file like this 003ABC00281020091005000100042.810001 ... (8 Replies)
Discussion started by: Maruti
8 Replies

3. Shell Programming and Scripting

delete rows in a file based on the rows of another file

I need to delete rows based on the number of lines in a different file, I have a piece of code with me working but when I merge with my C application, it doesnt work. sed '1,'\"`wc -l < /tmp/fileyyyy`\"'d' /tmp/fileA > /tmp/filexxxx Can anyone give me an alternate solution for the above (2 Replies)
Discussion started by: Muthuraj K
2 Replies

4. Shell Programming and Scripting

Change in Input feed based on condition file

Sorry Guys for not being able to explain in one of my earlier post. I am now putting my requirement with the input file and desired output file. In the below input file - Transaction code is at position 31:40. Business code is from position 318:321 TSCM00000005837 ... (7 Replies)
Discussion started by: varunrbs
7 Replies

5. UNIX for Dummies Questions & Answers

merging rows into new file based on rows and first column

I have 2 files, file01= 7 columns, row unknown (but few) file02= 7 columns, row unknown (but many) now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there e.g. file 01 James|0|50|25|10|50|30... (1 Reply)
Discussion started by: A-V
1 Replies

6. Shell Programming and Scripting

Select distinct rows in a file by last column

Hi, I have the following file: LOG:015608::ERR:2310:map_spsrec:Invalid parameter LOG:015608::ERR:2471:map_dgdrec:Invalid parameter LOG:015608::ERR:2487:map_nnmrec:Invalid number LOG:015608::ERR:2310:map_nmrec:Invalid number LOG:015608::ERR:2438:map_nmrec:Invalid number As a delimiter I... (2 Replies)
Discussion started by: apenkov
2 Replies

7. UNIX for Dummies Questions & Answers

Feed Input to a script running on bash

Hi Sir, I am just learning bash scripting and I came across a challenge. I need to input F11 to a script among many text inputs. For all the text inputs i did following. # sh test.sh < input.txt where input.txt contains all the text inputs in new lines. This worked fine until i... (1 Reply)
Discussion started by: gaurav kumar
1 Replies

8. UNIX for Dummies Questions & Answers

Select last update data based on file name

Hi All, I need to remove all files except the most update data based on date on filename Input data_AIDS_20150312.txt data_AIDS_20150311.txt data_AIDS_20150411.txt data_AIDS_20140312.txt the most updated data is data_AIDS_20150411.txt, so I'll remove other files. My expected output... (3 Replies)
Discussion started by: radius
3 Replies

9. Shell Programming and Scripting

Execute function as soon as input is provided in menu drive shell script

Hi All, I have a menu driven scripts. As you know while running the script we have to input the option such as 1,2, and 3 to execute function accordingly. but after selecting the input we have to press Enter. My requirement is to execute function as soon as we press the option. Is there... (5 Replies)
Discussion started by: kiran_j
5 Replies

10. UNIX for Beginners Questions & Answers

How to iterate Grep via all patterns provided in an input file?

When I use the following grep command with options -F and -f, its just displaying the text related to only the last pattern. Command: $ grep -f pattern_file.txt input_file.txt Output: doc-C2-16354 Even the following command yields the same output: Command: $ grep -Ff pattern_file.txt... (6 Replies)
Discussion started by: nsai
6 Replies
DateTime::Locale::gl_ES(3)				User Contributed Perl Documentation				DateTime::Locale::gl_ES(3)

NAME
DateTime::Locale::gl_ES SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'gl_ES' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Galician Spain. DATA
This locale inherits from the DateTime::Locale::gl locale. It contains the following data. Days Wide (format) Luns Martes Mercores Xoves Venres Sabado Domingo Abbreviated (format) Lun Mar Mer Xov Ven Sab Dom Narrow (format) L M M X V S D Wide (stand-alone) Luns Martes Mercores Xoves Venres Sabado Domingo Abbreviated (stand-alone) Lun Mar Mer Xov Ven Sab Dom Narrow (stand-alone) L M M X V S D Months Wide (format) Xaneiro Febreiro Marzo Abril Maio Xun~o Xullo Agosto Setembro Outubro Novembro Decembro Abbreviated (format) Xan Feb Mar Abr Mai Xun~ Xul Ago Set Out Nov Dec Narrow (format) X F M A M X X A S O N D Wide (stand-alone) Xaneiro Febreiro Marzo Abril Maio Xun~o Xullo Agosto Setembro Outubro Novembro Decembro Abbreviated (stand-alone) Xan Feb Mar Abr Mai Xun~ Xul Ago Set Out Nov Dec Narrow (stand-alone) X F M A M X X A S O N D Quarters Wide (format) 1o trimestre 2o trimestre 3o trimestre 4o trimestre Abbreviated (format) T1 T2 T3 T4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1o trimestre 2o trimestre 3o trimestre 4o trimestre Abbreviated (stand-alone) T1 T2 T3 T4 Narrow (stand-alone) 1 2 3 4 Eras Wide antes de Cristo despois de Cristo Abbreviated a.C. d.C. Narrow a.C. d.C. Date Formats Full 2008-02-05T18:30:30 = Martes 05 Febreiro 2008 1995-12-22T09:05:02 = Venres 22 Decembro 1995 -0010-09-15T04:44:23 = Sabado 15 Setembro -10 Long 2008-02-05T18:30:30 = 05 Febreiro 2008 1995-12-22T09:05:02 = 22 Decembro 1995 -0010-09-15T04:44:23 = 15 Setembro -10 Medium 2008-02-05T18:30:30 = 5 Feb, 2008 1995-12-22T09:05:02 = 22 Dec, 1995 -0010-09-15T04:44:23 = 15 Set, -10 Short 2008-02-05T18:30:30 = 05/02/08 1995-12-22T09:05:02 = 22/12/95 -0010-09-15T04:44:23 = 15/09/-10 Default 2008-02-05T18:30:30 = 5 Feb, 2008 1995-12-22T09:05:02 = 22 Dec, 1995 -0010-09-15T04:44:23 = 15 Set, -10 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 = Martes 05 Febreiro 2008 18:30:30 UTC 1995-12-22T09:05:02 = Venres 22 Decembro 1995 09:05:02 UTC -0010-09-15T04:44:23 = Sabado 15 Setembro -10 04:44:23 UTC Long 2008-02-05T18:30:30 = 05 Febreiro 2008 18:30:30 UTC 1995-12-22T09:05:02 = 22 Decembro 1995 09:05:02 UTC -0010-09-15T04:44:23 = 15 Setembro -10 04:44:23 UTC Medium 2008-02-05T18:30:30 = 5 Feb, 2008 18:30:30 1995-12-22T09:05:02 = 22 Dec, 1995 09:05:02 -0010-09-15T04:44:23 = 15 Set, -10 04:44:23 Short 2008-02-05T18:30:30 = 05/02/08 18:30 1995-12-22T09:05:02 = 22/12/95 09:05 -0010-09-15T04:44:23 = 15/09/-10 04:44 Default 2008-02-05T18:30:30 = 5 Feb, 2008 18:30:30 1995-12-22T09:05:02 = 22 Dec, 1995 09:05:02 -0010-09-15T04:44:23 = 15 Set, -10 04:44:23 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 Mar 1995-12-22T09:05:02 = 22 Ven -0010-09-15T04:44:23 = 15 Sab Hm (HH:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 PM 1995-12-22T09:05:02 = 9:05 AM -0010-09-15T04:44:23 = 4:44 AM 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 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM 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 = Mar, 5-2 1995-12-22T09:05:02 = Ven, 22-12 -0010-09-15T04:44:23 = Sab, 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 = Feb 1995-12-22T09:05:02 = Dec -0010-09-15T04:44:23 = Set MMMd (d MMM) 2008-02-05T18:30:30 = 5 Feb 1995-12-22T09:05:02 = 22 Dec -0010-09-15T04:44:23 = 15 Set MMMEd (E d MMM) 2008-02-05T18:30:30 = Mar 5 Feb 1995-12-22T09:05:02 = Ven 22 Dec -0010-09-15T04:44:23 = Sab 15 Set MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 Febreiro 1995-12-22T09:05:02 = 22 Decembro -0010-09-15T04:44:23 = 15 Setembro MMMMdd (dd MMMM) 2008-02-05T18:30:30 = 05 Febreiro 1995-12-22T09:05:02 = 22 Decembro -0010-09-15T04:44:23 = 15 Setembro MMMMEd (E d MMMM) 2008-02-05T18:30:30 = Mar 5 Febreiro 1995-12-22T09:05:02 = Ven 22 Decembro -0010-09-15T04:44:23 = Sab 15 Setembro 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 (M-yyyy) 2008-02-05T18:30:30 = 2-2008 1995-12-22T09:05:02 = 12-1995 -0010-09-15T04:44:23 = 9--010 yMEd (EEE, d-M-yyyy) 2008-02-05T18:30:30 = Mar, 5-2-2008 1995-12-22T09:05:02 = Ven, 22-12-1995 -0010-09-15T04:44:23 = Sab, 15-9--010 yMMM (MMM y) 2008-02-05T18:30:30 = Feb 2008 1995-12-22T09:05:02 = Dec 1995 -0010-09-15T04:44:23 = Set -10 yMMMEd (EEE, d MMM y) 2008-02-05T18:30:30 = Mar, 5 Feb 2008 1995-12-22T09:05:02 = Ven, 22 Dec 1995 -0010-09-15T04:44:23 = Sab, 15 Set -10 yMMMM (MMMM y) 2008-02-05T18:30:30 = Febreiro 2008 1995-12-22T09:05:02 = Decembro 1995 -0010-09-15T04:44:23 = Setembro -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 = T1 2008 1995-12-22T09:05:02 = T4 1995 -0010-09-15T04:44:23 = T3 -10 yyMM (MM/yy) 2008-02-05T18:30:30 = 02/08 1995-12-22T09:05:02 = 12/95 -0010-09-15T04:44:23 = 09/-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 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = Febreiro 2008 1995-12-22T09:05:02 = Decembro 1995 -0010-09-15T04:44:23 = Setembro -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week Luns 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.3 2014-06-10 DateTime::Locale::gl_ES(3)
All times are GMT -4. The time now is 11:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy