Sponsored Content
Top Forums Shell Programming and Scripting Extracting unique values of a column from a feed file Post 302893997 by punpun66 on Sunday 23rd of March 2014 02:10:55 AM
Old 03-23-2014
Wrench Extracting unique values of a column from a feed file

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 ,
can you please advise the script or command that will extract the unique ADM_ID and will store those unique ADM_ID in a newly created file the name of the newly created file is Unique_ADM and this file will be stored at the same location .


so the newly created Unique_ADM file will contain the following data that it will extract from the above feed file..

Code:
861
831
811

please advise how to achieve this.Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

return a list of unique values of a column from csv format file

Hi all, I have a huge csv file with the following format of data, Num SNPs, 549997 Total SNPs,555352 Num Samples, 157 SNP, SampleID, Allele1, Allele2 A001,AB1,A,A A002,AB1,A,A A003,AB1,A,A ... ... ... I would like to write out a list of unique SNP (column 1). Could you... (3 Replies)
Discussion started by: phoeberunner
3 Replies

2. Shell Programming and Scripting

print unique values of a column and sum up the corresponding values in next column

Hi All, I have a file which is having 3 columns as (string string integer) a b 1 x y 2 p k 5 y y 4 ..... ..... Question: I want get the unique value of column 2 in a sorted way(on column 2) and the sum of the 3rd column of the corresponding rows. e.g the above file should return the... (6 Replies)
Discussion started by: amigarus
6 Replies

3. UNIX for Dummies Questions & Answers

Extracting rows from a text file based on numerical values of a column

I have a text file where the second column is a list of numbers going from small to large. I want to extract the rows where the second column is smaller than or equal to 0.0001. My input: rs10082730 9e-08 12 46002702 rs2544081 1e-07 12 46015487 rs1425136 1e-06 7 35396742 rs2712590... (1 Reply)
Discussion started by: evelibertine
1 Replies

4. UNIX for Dummies Questions & Answers

Extracting rows from a space delimited text file based on the values of a column

I have a space delimited text file. I want to extract rows where the third column has 0 as a value and write those rows into a new space delimited text file. How do I go about doing that? Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies

5. Shell Programming and Scripting

AWK, Perl or Shell? Unique strings and their maximum values from 3 column data file

I have a file containing data like so: 2012-01-02 GREEN 4 2012-01-02 GREEN 6 2012-01-02 GREEN 7 2012-01-02 BLUE 4 2012-01-02 BLUE 3 2012-01-02 GREEN 4 2012-01-02 RED 4 2012-01-02 RED 8 2012-01-02 GREEN 4 2012-01-02 YELLOW 5 2012-01-02 YELLOW 2 I can't always predict what the... (4 Replies)
Discussion started by: rich@ardz
4 Replies

6. Shell Programming and Scripting

Script for extracting data from csv file based on column values.

Hi all, I am new to shell script.I need your help to write a shell script. I need to write a shell script to extract data from a .csv file where columns are ',' separated. The file has 5 columns having values say column 1,column 2.....column 5 as below along with their valuesm.... (3 Replies)
Discussion started by: Vivekit82
3 Replies

7. Linux

To get all the columns in a CSV file based on unique values of particular column

cat sample.csv ID,Name,no 1,AAA,1 2,BBB,1 3,AAA,1 4,BBB,1 cut -d',' -f2 sample.csv | sort | uniq this gives only the 2nd column values Name AAA BBB How to I get all the columns of CSV along with this? (1 Reply)
Discussion started by: sanvel
1 Replies

8. UNIX for Dummies Questions & Answers

Unique values in a row sum the next column in UNIX

Hi would like to ask you guys any advise regarding my problem I have this kind of data file.txt 111111111,20 111111111,50 222222222,70 333333333,40 444444444,10 444444444,20 I need to get this file1.txt 111111111,70 222222222,70 333333333,40 444444444,30 using this code I can... (6 Replies)
Discussion started by: reks
6 Replies

9. UNIX for Beginners Questions & Answers

Find unique values but only in column 1

Hi All, Does anyone have any suggestions/examples of how i could show only lines where the first field is not duplicated. If the first field is listed more than once it shouldnt be shown even if the other columns make it unique. Example file : 876,RIBDA,EC2 876,RIBDH,EX7 877,RIBDF,E28... (4 Replies)
Discussion started by: mutley2202
4 Replies

10. Shell Programming and Scripting

Count number of unique values in each column of array

What is an efficient way of counting the number of unique values in a 400 column by 1000 row array and outputting the counts per column, assuming the unique values in the array are: A, B, C, D In other words the output should look like: Value COL1 COL2 COL3 A 50 51 52... (16 Replies)
Discussion started by: Geneanalyst
16 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.18.2 2017-10-06 DateTime::Locale::gl_ES(3)
All times are GMT -4. The time now is 07:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy