I would like to delete lines containing duplicated strings in the second column.
test.txt
output.txt
I know sed can delete lines with predefined specific strings, but in my cases, I could not expect the strings are duplicated. Also, duplicated strings will be more than 1000.
I used “uniq” to do this job, but this does not work.
uniq -u -f 4 test.txt
(-u prints unique lines. -f skips the first 4 letters. )
Is there any way to do this with sed/awk/perl? Or please correct my uniq semantics.
Hi all,
I'd always appreciate all helps from this site.
I would like to delete duplicated chunks of strings on the same row(?).
One chunk is comprised of four lines such as:
path name
starting point
ending point
voltage number
I would like to delete duplicated chunks on the same... (5 Replies)
Dear All,
Suppose I have a file:
1 1 1 1
2 2 2 2
3 3 3 3I want to insert new line under each old line so that the file would become:
1 1 1 1
1 1 1 1
2 2 2 2
2 2 2 2
3 3 3 3
3 3 3 3How can this be accomplished using awk (or sed)? (5 Replies)
Hi Guys..
I have a problem for some reason my database has copied everything 4 times.
My Database looks like this:
>BAC233456
rhjieaheiohjteo
tjtjrj6jkk6k6
j54ju54jh54jh
>ANI124365
afrhtjykulilil
htrjykuk
rtkjryky
ukrykyrk
>BAC233456
rhjieaheiohjteo
tjtjrj6jkk6k6
j54ju54jh54jh... (6 Replies)
The question is not as simple as the title... I have a file, it looks like this
<string name="string1">RZ-LED</string>
<string name="string2">2.0</string>
<string name="string2">Version 2.0</string>
<string name="string3">BP</string>
I would like to check for duplicate entries of... (11 Replies)
Hello all,
I've got a strange behaviour of sort and uniq commands: they do not recognise apparently duplicated lines in a file (already sorted). The lines are identical by eye, but they must differ in smth, because when they are put in two files, those have slightly different size.
What can make... (8 Replies)
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)
Hi
Just wondering whether or not I can remove duplicated lines without sort
For example, I use the command who, which shows users who are logging on. In some cases, it shows duplicated lines of users who are logging on more than one terminal.
Normally, I would do
who | cut -d" " -f1 |... (6 Replies)