09-01-2010
Quote:
Originally Posted by
rdcwayx
awk, awk is smart enough to take out all non-digital characters, and consider it as 20100826010517
That's very good to know.
Is there a reason to have a[4]a[5] , why not just use a[4] and then awk doesn't even have to remove anything?
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I have to join two files based on 1st column where 4th column of a2.txt=at and take 2nd column of a1.txt and 3rd column of a2.txt and check against source files ,if matches list those source file names.
a1.txt
a1|20090809|20090810
a2|20090907|20090908
a2.txt
a1|d|file1.txt|at... (9 Replies)
Discussion started by: akil
9 Replies
2. Shell Programming and Scripting
I have my data something like this
(08/03/2009 22:57:42.414)(:) king aaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbb
(08/03/2009 22:57:42.416)(:) John cccccccccccc cccccvssssssssss baaaaa
(08/03/2009 22:57:42.417)(:) Michael ddddddd tststststtststts
(08/03/2009 22:57:42.425)(:) Ravi... (11 Replies)
Discussion started by: rdhanek
11 Replies
3. UNIX for Dummies Questions & Answers
Hi,
How to output the duplicate record to another file. We say the record is duplicate based on a column whose position is from 2 and its length is 11 characters.
The file is a fixed width file.
ex of Record:
DTYU12333567opert tjhi kkklTRG9012
The data in bold is the key on which... (1 Reply)
Discussion started by: Qwerty123
1 Replies
4. Shell Programming and Scripting
Hi All,
I needs to fetch unique records based on a keycolumn(ie., first column1) and also I needs to get the records which are having max value on column2 in sorted manner... and duplicates have to store in another output file.
Input :
Input.txt
1234,0,x
1234,1,y
5678,10,z
9999,10,k... (7 Replies)
Discussion started by: kmsekhar
7 Replies
5. Shell Programming and Scripting
Hello,
I am new to shell scripting. I have a huge file with multiple columns for example:
I have 5 columns below.
HWUSI-EAS000_29:1:105 + chr5 76654650 AATTGGAA HHHHG
HWUSI-EAS000_29:1:106 + chr5 76654650 AATTGGAA B@HYL
HWUSI-EAS000_29:1:108 + ... (4 Replies)
Discussion started by: Diya123
4 Replies
6. Shell Programming and Scripting
Hi all,
I have an input file like this
Now
I have to remove duplicates only in first column and nothing has to be changed in second and third column. so that output would be
Please let me know scripting regarding this (20 Replies)
Discussion started by: manigrover
20 Replies
7. Shell Programming and Scripting
Hi all
I have following kind of input file
ESR1 PA156 leflunomide PA450192 leflunomide
CHST3 PA26503 docetaxel Pa4586; thalidomide Pa34958; decetaxel docetaxel docetaxel
I want to remove duplicates and I want to separate anything before and after PAxxxx entry into columns or... (1 Reply)
Discussion started by: manigrover
1 Replies
8. Shell Programming and Scripting
Hi Experts ,
we have a CDC file where we need to get the latest record of the Key columns
Key Columns will be CDC_FLAG and SRC_PMTN_I
and fetch the latest record from the CDC_PRCS_TS
Can we do it with a single awk command.
Please help.... (3 Replies)
Discussion started by: vijaykodukula
3 Replies
9. Shell Programming and Scripting
Hi all,
I have huge a tab-delimited file with the following format and I want to remove the duplicates according to their frequency based on Column2 and Column3.
Column1 Column2 Column3 Column4 Column5 Column6 Column7
1 user1 access1 word word 3 2
2 user2 access2 ... (10 Replies)
Discussion started by: corfuitl
10 Replies
LEARN ABOUT DEBIAN
emgrip-dupes
EMGRIP-DUPES(1) User Contributed Perl Documentation EMGRIP-DUPES(1)
NAME
emgrip-dupes - find packages listed in more than one component
Synopsis
Syntax: emgrip-dupes -b PATH [OPTIONS]
emgrip-dupes -b PATH -m|--merge NAME [OPTIONS]
emgrip-dupes -b PATH -p|--purge NAME [OPTIONS]
emgrip-dupes -?|-h|--help|--version
Commands:
-b|--base-path PATH: path to the top level grip directory [required]
-a|--arch ARCHITECTURE: architecture to test [default: i386]
-m|--merge NAMES: retain this duplicate at the latest version in all
-p|--purge NAMES: remove the duplicates from 'main'
-t|--trim NAMES: retain the duplicates in main only
-?|-h|--help|--version: print this help message and exit
Options:
--grip-name STRING: alternative name for the grip repository
-s|--suite SUITE: suite to check (default: unstable)
-n|--dry-run: print the reprepro commands that would be used.
Description
emgrip-dupes scans the Grip repository Packages data and configuration, identifies the supported list of components in the requested suite.
In some cases, these duplicates are useful and only a small amount of space is taken up by the extra listing. However, the version in one
component can easily be out of sync with the version in another.
The main emphasis is on the size of the Packages file for the 'main' component (the one that every user needs to download). Purge mode will
remove the listing of the specified package from 'main'. Merge mode will bring the outdated version into line with the most recent version
of the package so that all components list the most recent version.
Limitations
Next step is to automate the "correction" of the duplicates but this does need care. Manual corrections involve identifying the packages to
retain in main (where the duplicate in dev, doc or debug is not wanted) and pass those to --trim.
The more complex case is to remove from main (e.g. package name suffix is -dev or -doc or -dbg or the Section is devel, dbg, doc or
libdevel). emgrip-dupes --purge removes each binary separately because removing the package from main in a single operation will also
remove the source. This is a particular problem if the source package also builds binary packages that are intended for main, e.g. dbus.
Copyright and Licence
Copyright (C) 2009 Neil Williams <codehelp@debian.org>
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
perl v5.12.3 2011-03-27 EMGRIP-DUPES(1)