Sponsored Content
Top Forums Shell Programming and Scripting Highlighting duplicate string on a line Post 302916707 by junior-helper on Thursday 11th of September 2014 12:01:54 PM
Old 09-11-2014
May I present my approach Smilie
Code:
#!/bin/bash

while read value; do 
 len=${#value}
 center=`expr $len / 2`
 firsthalf=${value:0:center}
 secondhalf=${value:center:len}
  if [ "$firsthalf" == "$secondhalf" ]; then
   echo "$value"
  fi
done <values >truedupes

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

removing line and duplicate line

Hi, I have 3 lines in a text file that is similar to this (as a result of a diff between 2 files): 35,36d34 < DATA.EVENT.EVENT_ID.s = "3661208" < DATA.EVENT.EVENT_ID.s = "3661208" I am trying to get it down to just this: DATA.EVENT.EVENT_ID.s = "3661208" How can I do this?... (11 Replies)
Discussion started by: ocelot
11 Replies

2. Shell Programming and Scripting

How to remove duplicate sentence/string in perl?

Hi, I have two strings like this in an array: For example: @a=("Brain aging is associated with a progressive imbalance between intracellular concentration of Reactive Oxygen Species","Brain aging is associated with a progressive imbalance between intracellular concentration of Reactive... (9 Replies)
Discussion started by: vanitham
9 Replies

3. Shell Programming and Scripting

filtering out duplicate substrings, regex string from a string

My input contains a single word lines. From each line data.txt prjtestBlaBlatestBlaBla prjthisBlaBlathisBlaBla prjthatBlaBladpthatBlaBla prjgoodBlaBladpgoodBlaBla prjgood1BlaBla123dpgood1BlaBla123 Desired output --> data_out.txt prjtestBlaBla prjthisBlaBla... (8 Replies)
Discussion started by: kchinnam
8 Replies

4. Shell Programming and Scripting

Delete duplicate in certain number of string

Hi, do you have awk or sed sommand taht will delete duplicate lines like. sample: server1-log1-14 server1-log2-14 superserver-time-2 superserver-log-2 output: server-log1-14 superserver-time-2 thansk (2 Replies)
Discussion started by: kenshinhimura
2 Replies

5. Shell Programming and Scripting

find duplicate string in many different files

I have more than 100 files like this: SVEAVLTGPYGYT 2 SVEGNFEETQY 10 SVELGQGYEQY 28 SVERTGTGYT 6 SVGLADYNEQF 21 SVGQGYEQY 32 SVKTVLGYEQF 2 SVNNEQF 12 SVRDGLTNSPLH 3 SVRRDREGLEQF 11 SVRTSGSYEQY 17 SVSVSGSPLQETQY 78 SVVHSTSPEAF 59 SVVPGNGYT 75 (4 Replies)
Discussion started by: xshang
4 Replies

6. Shell Programming and Scripting

Remove not only the duplicate string but also the keyword of the string in Perl

Hi Perl users, I have another problem with text processing in Perl. I have a file below: Linux Unix Linux Windows SUN MACOS SUN SUN HP-AUX I want the result below: Unix Windows SUN MACOS HP-AUX so the duplicate string will be removed and also the keyword of the string on... (2 Replies)
Discussion started by: askari
2 Replies

7. Shell Programming and Scripting

Honey, I broke awk! (duplicate line removal in 30M line 3.7GB csv file)

I have a script that builds a database ~30 million lines, ~3.7 GB .cvs file. After multiple optimzations It takes about 62 min to bring in and parse all the files and used to take 10 min to remove duplicates until I was requested to add another column. I am using the highly optimized awk code: awk... (34 Replies)
Discussion started by: Michael Stora
34 Replies

8. Red Hat

How to add a new string at the end of line by searching a string on the same line?

Hi, I have a file which is an extract of jil codes of all autosys jobs in our server. Sample jil code: ************************** permission:gx,wx date_conditions:yes days_of_week:all start_times:"05:00" condition: notrunning(appDev#box#ProductLoad)... (1 Reply)
Discussion started by: raghavendra
1 Replies

9. Shell Programming and Scripting

Highlighting duplicate string on a line

Hi all I have a grep written to pull out values; below (in the code snip-it) is an example of the output. What I'm struggling to do, and looking for assistance on, is identifying the lines that have duplicate strings. For example 74859915K74859915K in the below is 74859915K repeated twice but... (3 Replies)
Discussion started by: brighty
3 Replies

10. Shell Programming and Scripting

Shell script to get duplicate string

Hi All, I have a requirement where I have to get the duplicate string count and uniq error message. Below is my file: Rejected - Error on table TableA, column ColA. Error String 1. Rejected - Error on table TableA, column ColB. Error String 2. Rejected - Error on table TableA, column... (6 Replies)
Discussion started by: Deekhari
6 Replies
gnome-control-center(1) 					   User Commands					   gnome-control-center(1)

NAME
gnome-control-center, gnome-desktop-prefs - configure GNOME desktop preferences SYNOPSIS
gnome-control-center [-h] [gnome-std-options] DESCRIPTION
gnome-control-center enables the user to configure their GNOME desktop. Most configuration choices can also be accessed directly from the GNOME Panel Preferences menu. Note: The gnome-control-center application also provides a library called libgnome-window-settings. This library is licensed under GPL. Please see the license file at /usr/share/doc/SUNWgnome-desktop-prefs/gnome-control-center-2.24.0.1/COPYING.bz2 for implications when writ- ing a program which uses this library. OPTIONS
The following options are supported: -h Do not update the library with file changes. gnome-std-options Standard options available for use with most GNOME applications. See gnome-std-options(5). EXAMPLES
Example 1: Launching Desktop Preferences example% gnome-control-center EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/gnome-control-center Executable for Desktop Preferences interface /usr/share/doc/SUNWgnome-desktop-prefs/gnome-control-center-2.24.0.1/COPYING.bz2 Location of license file ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-desktop-prefs | +-----------------------------+-----------------------------+ |Interface stability |Volatile | +-----------------------------+-----------------------------+ SEE ALSO
Preference Tools Manual Latest version of the GNOME Desktop User Guide for your platform. cddb-slave2-properties(1), gnome-accessibility-keyboard-properties(1), gnome-appearance-properties(1), gnome-at-properties(1), gnome- default-applications-properties(1), gnome-display-properties(1), gnome-keybinding-properties(1), gnome-keyboard-properties(1), gnome-mouse- properties(1), gnome-network-preferences(1), gnome-session-properties(1), gnome-sound-properties(1), gnome-ui-properties(1), gnome-window- properties(1), gstreamer-properties(1), nautilus-file-management-properties(1), bzip2(1), attributes(5), gnome-std-options(5) http://www.fsf.org/licensing/ NOTES
Written by Glynn Foster, updated by Brian Cameron and Halton Huo, Sun Microsystems Inc., 2003, 2006, 2007, 2008. SunOS 5.11 16 Sep 2008 gnome-control-center(1)
All times are GMT -4. The time now is 03:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy