Sponsored Content
Top Forums Shell Programming and Scripting Delete duplicate strings in a line Post 302879523 by Akshay Hegde on Thursday 12th of December 2013 09:25:57 PM
Old 12-12-2013
OR
Code:
$ awk 'substr($1,2) == $2{$2=x;$0=$0;$1=$1}1' file

&aff2g0440 aspl2221 nos:scad1 blablablabla
&aff2g0740 aspl5221 nos:scad1 blablablabla
&aff4g0160 aff4g01600 aspl2251 nos:scad1 blablablabla
&aff9g0020 aspl3391 nos:scad2 blablablabla

This User Gave Thanks to Akshay Hegde For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Delete lines with duplicate strings based on date

Hey all, a relative bash/script newbie trying solve a problem. I've got a text file with lots of lines that I've been able to clean up and format with awk/sed/cut, but now I'd like to remove the lines with duplicate usernames based on time stamp. Here's what the data looks like 2007-11-03... (3 Replies)
Discussion started by: mattv
3 Replies

2. Shell Programming and Scripting

delete repeated strings (tags) in a line and concatenate corresponding words

Hello friends! Each line of my input file has this format: word<TAB>tag1<blankspace>lemma<TAB>tag2<blankspace>lemma ... <TAB>tag3<blankspace>lemma Of this file I need to eliminate all the repeated tags (of the same word) in a line, as in the example here below, but conserving both (all) the... (2 Replies)
Discussion started by: mjomba
2 Replies

3. UNIX for Dummies Questions & Answers

Delete strings in file1 based on the list of strings in file2

Hello guys, should be a very easy questn for you: I need to delete strings in file1 based on the list of strings in file2. like file2: word1_word2_ word3_word5_ word3_word4_ word6_word7_ file1: word1_word2_otherwords..,word3_word5_others... (7 Replies)
Discussion started by: roussine
7 Replies

4. Shell Programming and Scripting

How to delete a duplicate line and original with sed.

I am completely new to shell scripting but have been assigned the task of creating several batch files to manipulate data. My final task requires me to find lines that have duplicates present then delete not only the duplicate but the original as well. The script will be used in a windows... (9 Replies)
Discussion started by: chino_1
9 Replies

5. UNIX for Dummies Questions & Answers

Delete duplicate second line

Hi ALL I need a help I need to retain only the first line of 035 if I have two line before =040 , if only one then need to take that Eg: Input =035 (ABC)12324141241 =035 (XYZPQR)704124 =040 AB$QS$WEWR =035 (ABC)08080880809 =035 (XYZPQR)9809314 =040 ... (4 Replies)
Discussion started by: umapearl
4 Replies

6. Shell Programming and Scripting

Delete lines in file containing duplicate strings, keeping longer strings

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)
Discussion started by: raidzero
11 Replies

7. Shell Programming and Scripting

Delete Duplicate line (not really) from the file

I need help in figuring out hoe to delete lines in a data file. The data file is huge. I am currently using "vi" to search and delete the lines - which is cumbersome since it takes lots of time to save that file (due to its huge size). Here is the issue. I have a data file with the following... (4 Replies)
Discussion started by: GosarJunk
4 Replies

8. Shell Programming and Scripting

Delete 2 strings from 1 line with sed?

Hi guys, I wonder if it's possible to search for a line containing 2 strings and delete that line and perhaps replace the source file with already deleted line(s). What I mean is something like this: sourcefile.txt line1: something 122344 somethin2 24334 45554676 line2: another something... (6 Replies)
Discussion started by: netrom
6 Replies

9. UNIX for Dummies Questions & Answers

Log file - Delete duplicate line & keep last date

Hello All ! I need your help on this case, I have a csv file with this: ITEM105;ARI FSR;2016-02-01 08:02;243 ITEM101;ARI FSR;2016-02-01 06:02;240 ITEM032;RNO TLE;2016-02-01 11:03;320 ITEM032;RNO TLE;2016-02-02 05:43;320 ITEM032;RNO TLE;2016-02-01 02:03;320 ITEM032;RNO... (2 Replies)
Discussion started by: vadim-bzh
2 Replies

10. Shell Programming and Scripting

Find duplicate values in specific column and delete all the duplicate values

Dear folks I have a map file of around 54K lines and some of the values in the second column have the same value and I want to find them and delete all of the same values. I looked over duplicate commands but my case is not to keep one of the duplicate values. I want to remove all of the same... (4 Replies)
Discussion started by: sajmar
4 Replies
OPENCV_PERFORMANCE(1)						   User Commands					     OPENCV_PERFORMANCE(1)

NAME
opencv_performance - evaluate the performance of the classifier SYNOPSIS
opencv_performance [options] DESCRIPTION
opencv_performance evaluates the performance of the classifier. It takes a collection of marked up test images, applies the classifier and outputs the performance, i.e. number of found objects, number of missed objects, number of false alarms and other information. When there is no such collection available test samples may be created from single object image by the opencv_createsamples(1) utility. The scheme of test samples creation in this case is similar to training samples In the output, the table should be read: 'Hits' shows the number of correctly found objects 'Missed' shows the number of missed objects (must exist but are not found, also known as false negatives) 'False' shows the number of false alarms (must not exist but are found, also known as false positives) OPTIONS
opencv_performance supports the following options: -data classifier_directory_name The directory, in which the classifier can be found. -info collection_file_name File with test samples description. -maxSizeDiff max_size_difference Determine the size criterion of reference and detected coincidence. The default is 1.500000. -maxPosDiff max_position_difference Determine the position criterion of reference and detected coincidence. The default is 0.300000. -sf scale_factor Scale the detection window in each iteration. The default is 1.200000. -ni Don't save detection result to an image. This could be useful, if collection_file_name contains paths. -nos number_of_stages Number of stages to use. The default is -1 (all stages are used). -rs roc_size The default is 40. -h sample_height The sample height (must have the same value as used during creation). The default is 24. -w sample_width The sample width (must have the same value as used during creation). The default is 24. The same information is shown, if opencv_performance is called without any arguments/options. EXAMPLES
To create training samples from one image applying distortions and show the results: opencv_performance -data trainout -info tests.dat SEE ALSO
opencv_createsamples(1), opencv_haartraing(1) More information and examples can be found in the OpenCV documentation. AUTHORS
This manual page was written by Daniel Leidert <daniel.leidert@wgdd.de> and Nobuhiro Iwamatsu <iwamatsu@debian.org> for the Debian project (but may be used by others). OpenCV May 2010 OPENCV_PERFORMANCE(1)
All times are GMT -4. The time now is 08:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy