Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Repetition in a particular interval Post 302995045 by ANKIT ROY on Friday 31st of March 2017 05:43:17 AM
Old 03-31-2017
Input
Code:
AHSDGJOGDXBSAJVDGJDSVKKBDAZZGJJVD(the string)

D (the letter or a string to be searched)
Code:
0-5 7-14 20-30 35-41(the intervals)

Output
Code:
1(Freq of D) 4(location)
1 8
2 15,18
1 24
1 41


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 03-31-2017 at 06:45 AM.. Reason: Added CODE tags.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Random numbers without repetition

Is anyone know some scripts to generate random number without repetition using bash; for example generate 10 different random numbers. Thanks (8 Replies)
Discussion started by: asal_email
8 Replies

2. UNIX for Advanced & Expert Users

Looping/Repetition in Batch files

Hi All, I'm just new to UNIX, does anyone know how to create a batch file in UNIX that does the following routines: 1.) process multiple files in a directory in DOS, I set my sample input file as: set INPUTFILE=%1 in UNIX>> ???? 2.) every file to be processed by executing a program... (1 Reply)
Discussion started by: kimpot7268
1 Replies

3. Shell Programming and Scripting

Looping/Repetition in Batch files

Hi All, I'm just new to UNIX, does anyone know how to create a batch file in UNIX that does the following routines: 1.) process multiple files in a directory in DOS, I set my sample input file as: set INPUTFILE=%1 in UNIX>> ???? 2.) every file to be processed by executing a program... (2 Replies)
Discussion started by: kimpot7268
2 Replies

4. Shell Programming and Scripting

compare the interval of 2 numbers of input2with interval of several numbers of input1

Help plz Does any one have any idea how to compare interval ranges of 2 files. finding 1-4 (1,2,3,4) of input2 in input1 of same key "a" values (5-10, 30-40, 45-60, 80-90, 100-120 ). Obviously 1-4 is not one of the range with in input1 a. so it should give out of range. finding 30-33(31,32,33)... (1 Reply)
Discussion started by: repinementer
1 Replies

5. Shell Programming and Scripting

Count the repetition of a Field in File

Hi, Thanks for keeping such a help-full platform active and live always. I am new to this forum and to unix also. Want to know how to count the repetition of a field in a file. Anything of awk, sed, perl, shell script, solution are welcomed. Input File------------------ abc,12345 pqr,51223... (10 Replies)
Discussion started by: indian.ace
10 Replies

6. Programming

Words combinations without repetition

How can I get all combinations of 5 words from 10 words. For example I have 3 words and I want to get all combinations of 2 words. "A", "B", "C" it would like AB, BC, AC. Maybe you know some usefull code or example. Thanx a lot. P.S. Sorry if I'm not right enough cause I don't know English... (2 Replies)
Discussion started by: romeo5577
2 Replies

7. UNIX for Advanced & Expert Users

Counting the number of repetition of a pattern

the o/p of a command is -bash-2.05b# grep -o a * cc:a dd:a a dd:a office:a a a a a a a a a a a a a a (2 Replies)
Discussion started by: an2up
2 Replies

8. Shell Programming and Scripting

repetition calculation

cat mylist First_NAME Gender Mike M Sara F Raya M Sara F Fibi F Mike M Mike M Micheal M can someone please help me to get a script to cacluate the number of repetions for each (First name... (3 Replies)
Discussion started by: Sara_84
3 Replies

9. Shell Programming and Scripting

Help with awk for selecting lines in a file avoiding repetition

Hello, I am using Awk in UBUNTU 12.04. I have a file as following with 48,432,354 lines and 4 fields. The file has this structure (There are repetitions of the first column in several lines) AB_14 S54 A G AB_14 S55 A A AB_14 S56 G G GO_15 S45 T A GO_15 S46 A A PT_16 S33 C C PT_16 ... (4 Replies)
Discussion started by: Homa
4 Replies

10. Windows & DOS: Issues & Discussions

Adding same value to variables in does each repetition of command

So, I have this command: mkdir rolled for %%x in (*gif) do convert %%x -roll +2+6 %%x|move %%x rolled I'd like to have the +2 and +6 accumulate here. In each new gif tackled, it should increase by the amount: +2 (for x) and +6 (for y) Is this possible? I'm on Windows, DOS. (0 Replies)
Discussion started by: pasc
0 Replies
shevek::relative_time(3)				     Library Functions Manual					  shevek::relative_time(3)

NAME
shevek::relative_time - Time interval. SYNOPSIS
#include <time.hh> Public Member Functions relative_time () The default constructor creates an interval of 0. relative_time (timetype days, int hours, int minutes, int seconds, int nanoseconds=0) Construct an interval of a given size. relative_time (timetype seconds, unsigned nanoseconds) Fast constructor. relative_time operator+ (relative_time that) const Add two intervals. absolute_time operator+ (absolute_time that) const Add an interval to a moment. relative_time operator- (relative_time that) const Subtract two intervals. relative_time operator- () const Negate an interval. relative_time operator* (float c) const Scale an interval. relative_time operator/ (float c) const Scale an interval. relative_time operator% (relative_time that) const Modulo operator for two intervals. double operator/ (relative_time that) const Division of two intervals. relative_time & operator+= (relative_time that) Add an interval. relative_time & operator-= (relative_time that) Subtract an interval. relative_time & operator*= (float c) Scale the interval. relative_time & operator/= (float c) Scale the interval. relative_time & operator%= (relative_time that) Modulo. bool operator< (relative_time that) const Compare with another interval. bool operator> (relative_time that) const Compare with another interval. bool operator<= (relative_time that) const Compare with another interval. bool operator>= (relative_time that) const Compare with another interval. bool operator== (relative_time that) const bool operator!= (relative_time that) const unsigned nanoseconds () const Number of nanoseconds. unsigned seconds () const Number of seconds. unsigned minutes () const Number of minutes. unsigned hours () const Number of hours. unsigned days () const Number of days. bool isnegative () const Is this a negative interval? timetype total () const Total number of seconds, as encoded. Static Public Member Functions static void set_digits (unsigned num) Set number of digits to use when printing (for fractions of seconds). static unsigned get_digits () Get the number of digits that is used when printing. Friends std::ostream & operator<< (std::ostream &s, relative_time t) Write the interval to a std::ostream. Detailed Description Time interval. Constructor &; Destructor Documentation shevek::relative_time::relative_time (timetypeseconds, unsignednanoseconds) Fast constructor. This directly fills the members and is therefore slightly faster than the other constructors. However, the others aren't really slow either. Member Function Documentation bool shevek::relative_time::operator!= (relative_timethat) const Compare two intervals. Note that this is rarely a useful operation, because minor errors may be introduced by computations. bool shevek::relative_time::operator== (relative_timethat) const Compare two intervals. Note that this is rarely a useful operation, because minor errors may be introduced by computations. Author Generated automatically by Doxygen for libshevek from the source code. libshevek Fri May 11 2012 shevek::relative_time(3)
All times are GMT -4. The time now is 04:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy