Sponsored Content
Top Forums Shell Programming and Scripting finding duplicates in columns and removing lines Post 302262874 by ahmad_khouly on Saturday 29th of November 2008 10:27:33 AM
Old 11-29-2008
yes I did and it's didn't work,

I used the below one but it's take too long time :

touch D22
for id in ` cat D3 | awk '/BSC/{print $13}' | uniq`
do
grep $id D3 | head -1 >> D22
wait
done

note: D22 is output file and D3 is the input file.

is there any other suggestion ?? , thanks.

Last edited by ahmad_khouly; 11-29-2008 at 11:39 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Removing lines that are (same in content) based on columns

I have a file which looks like AA BB CC DD EE FF GG HH KK AA BB GG HH KK FF CC DD EE AA BB CC DD EE UU VV XX ZZ AA BB VV XX ZZ UU CC DD EE .... I want the script to give me only one line based on duplicate contents: AA BB CC DD EE FF GG HH KK AA BB CC DD EE UU VV XX ZZ (7 Replies)
Discussion started by: adsforall
7 Replies

2. Shell Programming and Scripting

Help removing lines with duplicated columns

Hi Guys... Please Could you help me with the following ? aaaa bbbb cccc sdsd aaaa bbbb cccc qwer as you can see, the 2 lines are matched in three fields... how can I delete this pupicate ? I mean to delete the second one if 3 fields were duplicated ? Thanks (14 Replies)
Discussion started by: yahyaaa
14 Replies

3. Shell Programming and Scripting

Finding duplicates from positioned substring across lines

I have million's of records each containing exactly 50 characters and have to check the uniqueness of 4 character substring of 50 character (postion known prior) and report if any duplicates are found. Eg. data... AAAA00000000000000XXXX0000 0000000000... upto50 chars... (2 Replies)
Discussion started by: gapprasath
2 Replies

4. Shell Programming and Scripting

Removing duplicates from string (not duplicate lines)

please help me in getting following: Input Desired output x="foo" foo x="foo foo" foo x="foo foo" foo x="foo abc foo" foo abc x="foo foo1 foo2" foo foo1 foo2 I need to remove duplicated from string.. (8 Replies)
Discussion started by: vickylife
8 Replies

5. Shell Programming and Scripting

finding duplicates in csv based on key columns

Hi team, I have 20 columns csv files. i want to find the duplicates in that file based on the column1 column10 column4 column6 coulnn8 coulunm2 . if those columns have same values . then it should be a duplicate record. can one help me on finding the duplicates, Thanks in advance. ... (2 Replies)
Discussion started by: baskivs
2 Replies

6. Shell Programming and Scripting

Help in removing duplicates

I have an input file abc.txt with info like: abcd rateuse inklite robet rateuse abcd I need to remove duplicates from the file (eg: abcd,rateuse) from the file and need to place the contents in same file abc.txt if needed can be placed in another file. can anyone help me in this :( (4 Replies)
Discussion started by: rkrish
4 Replies

7. Shell Programming and Scripting

Removing duplicates in fixed width file which has multiple key columns

Hi All , I have a requirement where I need to remove duplicates from a fixed width file which has multiple key columns .Also , need to capture the duplicate records into another file . File has 8 columns. Key columns are col1 and col2. Col1 has the length of 8 col 2 has the length of 3. ... (5 Replies)
Discussion started by: saj
5 Replies

8. Shell Programming and Scripting

UNIX scripting for finding duplicates and null records in pk columns

Hi, I have a requirement.for eg: i have a text file with pipe symbol as delimiter(|) with 4 columns a,b,c,d. Here a and b are primary key columns.. i want to process that file to find the duplicates and null values are in primary key columns(a,b) . I want to write the unique records in which... (5 Replies)
Discussion started by: praveenraj.1991
5 Replies

9. Shell Programming and Scripting

Removing duplicates from delimited file based on 2 columns

Hi guys,Got a bit of a bind I'm in. I'm looking to remove duplicates from a pipe delimited file, but do so based on 2 columns. Sounds easy enough, but here's the kicker... Column #1 is a simple ID, which is used to identify the duplicate. Once dups are identified, I need to only keep the one... (2 Replies)
Discussion started by: kevinprood
2 Replies

10. Shell Programming and Scripting

Removing carriage returns from multiple lines in multiple files of different number of columns

Hello Gurus, I have a multiple pipe separated files which have records going over multiple Lines. End of line separator is \n and records going over multiple lines have <CR> as separator. below is example from one file. 1|ABC DEF|100|10 2|PQ RS T|200|20 3| UVWXYZ|300|30 4| GHIJKL|400|40... (7 Replies)
Discussion started by: dJHa
7 Replies
0intro 0intro intro 0intro 2a 2a 6a 2a 8a 2a ka 2a va 2a xa 2a 2c
2c 6c 2c 8c 2c kc 2c vc 2c xc 2c 2l 2l 6l 2l 8l 2l kl 2l vl 2l xl
2l 81/2 81/2 label 81/2 window 81/2 wloc 81/2 acid acid acme acme
awd acme win acme 8al alef alef alef kal alef val alef ar ar  art
art  art2pic art ascii ascii unicode ascii awk awk basename base-
name bc bc bind bind mount bind unmount bind  bundle  bundle  c++
c++ c++/2c c++ c++/2l c++ c++/8c c++ c++/8l c++ c++/kc c++ c++/kl
c++ c++/vc c++ c++/vl c++ cal cal calendar calendar cat cat  read
cat  char  char  rschar char 1/2char char chgrp chgrp chmod chmod
cmp cmp comm comm con con cu con rx con telnet con  xmr  con  xms
con cp cp mv cp cpp cpp cpu cpu date date db db dc dc dd dd dela-
tex deroff deroff deroff diff diff doctype  doctype  du  du  echo
echo  ed  ed emacs emacs eqn eqn factor factor primes factor file
file fmt fmt fone fone fortune fortune	freq  freq  4s	games  5s
games  ana  games  catclock games clock games festoon games fire-
works games fsim games games games life games mandel games  plumb
games  smiley games swar games grap grap graph graph grep grep gs
gs hoc hoc hp hp join join broke kill kill kill ktrans ktrans lex
lex  look  look lp lp lc ls ls ls aliasmail mail edmail mail mail
mail seemail mail sendmail mail smtp mail smtpd mail to mail vis-
mon  mail  vwhois mail lookman man man man mc mc membername mk mk
mk mkdir mkdir mothra mothra netstat netstat news news nm nm p	p
page  page  netkey  passwd passwd passwd pcc pcc pic pic tpic pic
plot plot ppp ppp pppclient ppp pppserver ppp pr  pr  kprof  prof
prof  prof proof proof ps ps psu ps pbd pwd pwd pwd cd rc eval rc
exec rc exit rc flag rc rc rc rfork rc shift rc wait rc whatis rc
~  rc  rm rm B sam sam sam sam.save sam sed sed seq seq size size
sleep sleep sort sort spell spell sprog  spell	spin  spin  split
split start stop stop stop strings strings strip strip md5sum sum
sum sum syscall syscall tail  tail  32vfs  tapefs  cpiofs  tapefs
tapefs	tapefs tapfs tapefs tarfs tapefs tpfs tapefs v10fs tapefs
v6fs tapefs tar tar tbl tbl tcs tcs tee tee iwhois  tel  tel  tel
test test bibtex tex dvips tex dviselect tex latex tex mf tex tex
tex time time touch touch tr tr nroff  troff  troff  troff  tweak
tweak twig twig uniq uniq units units ki vi vi vi xi vi wc wc who
who whois who xd xd yacc yacc yesterday yesterday
All times are GMT -4. The time now is 02:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy