09-10-2008
multipe instance scenario in perl
letz say that my file has 7 records with only one field. So my file has:
11111111
000000000000000
1111
aaaabbbccc
1111111222000000
aaaaaaaa
zz
All i need is:
1. when the field has a repetition of the same instance(a-z or 0-9), i would consideer it to be invalid. eg.(11111111,000000000000000,1111,aaaaaaaa,zz are all invalid)
2.If there is a repetition of 2 or more instances,it is valid. (eg. 1111111222000000,aaaabbbccc is valid)
3. Please note that the length of each field may vary.
So, i am expecting the output:
aaaabbbccc
1111111222000000
I am not sure if the title of the thread suits the matter. Anyway, whoever crosses this thread i would appreciate your input. Thanks in advance!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Alright, I think I know what I am doing with sed(which probably means I don't). But I cant figure out how to replace just the first occurance of a string. I have tried sed, ed, and grep but can't seem to figure it out. If you have any suggestions I am open to anything! (3 Replies)
Discussion started by: IronHorse7
3 Replies
2. Shell Programming and Scripting
I have a script that runs every 15 minutes in cron that builds a web page.
It runs at 15, 28, 45 and 58 minutes past the hour. (pretty much evry 15 mins).
Every 2 hours from 6:28 to 18:28 it sends out emails if it finds errors. I do not want it sending email every single time it runs, every 15... (5 Replies)
Discussion started by: spacemancw
5 Replies
3. Shell Programming and Scripting
Hi,
I found the following awk script to transpose multiple (3) columns to multiple rows:
#===
BEGIN {FS=","}
{
for (i=1;i<=NF;i++)
{
arr=$i;
if(nf<= NF)
nf=NF;
}
nr=NR
}
END {
for(i=1;i<=nf;i++)
{ (8 Replies)
Discussion started by: Gery
8 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
I have a requirement, I had a parent directory Land under that we have sub directories
Yesterday,
Today and
Tommorrow
And we have a file test.txt under the above directories Yesterday, Today and Tommorrow
The data in the file test.txt under Yesterday folder is ... (5 Replies)
Discussion started by: somu_june
5 Replies
5. Shell Programming and Scripting
Hi
I am using command
awk '{printf $1 " "}' PMT_GGSN_WPP_APN-20110517* > outfile The * refers to 24 files (1 generated per hour per day) with each one having the output of
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
I need... (8 Replies)
Discussion started by: rob171171
8 Replies
6. Shell Programming and Scripting
I would like to execute multipe commands in a shell script. Please provide the commands for the below scenario:
Execute command1
if command1 is succesfull, then execute command2, command3,command4 in parallel
if command2, command3,command4 are success then run command 5 (3 Replies)
Discussion started by: p_gautham12
3 Replies
7. Shell Programming and Scripting
Extract of configuration file.
members server1.domain1.com,server2.domain2.com,server3.domain3.com
I am writing a script to remove the server members from a conf file. When I run the script the corresponding server should be removed from the file.
/root/server-remove.sh... (2 Replies)
Discussion started by: anilcliff
2 Replies
8. Shell Programming and Scripting
Hi, I have these list of files from with the following filename format (the last 3 characters are in julian days). I want the year info retained added with sequence number 01-12 to represent the month. any suggestion on how to automate the renaming process. many thanks.
original filenames ... (3 Replies)
Discussion started by: ida1215
3 Replies
9. Shell Programming and Scripting
Hi ,
I have file FSN.log which contains number 100. i have other Perl script when i run it , it ll increment this FSN.log value.
now my requirement is
when the count in FSN.log becomes 999, it should make the value to 100 again and Perl script to change the date or it should make the date... (2 Replies)
Discussion started by: santhoshks
2 Replies
10. UNIX for Dummies Questions & Answers
Hi,
In a parent directory there are several files in the form
IDENTIFIER1x
IDENTIFIER1.yyy
IDENTIFIER1_Z, etc
IDENTIFIER2x
IDENTIFIER2.yyy
IDENTIFIER2_Z, etc
IDENTIFIER3x
IDENTIFIER3.yyy,
IDENTIFIER3_Z, etcIn the same parent directory there are corresponding directories named... (7 Replies)
Discussion started by: spirospap
7 Replies
LEARN ABOUT HPUX
dtmmdbbookgetshorttitle
DtMmdbBookGetShortTitle(library call) DtMmdbBookGetShortTitle(library call)
NAME
DtMmdbBookGetShortTitle -- obtains the short title of a book
SYNOPSIS
#include <DtMmdb.h>
const char* DtMmdbBookGetShortTitle(
DtMmdbInfoRequest* request,
unsigned int* length);
DESCRIPTION
The DtMmdbBookGetShortTitle function returns the short title of the specified book object. Do not use the free function on the returned
pointer. Table lookup is involved when the identifier is specified by either the primary_oid or sequence_num field.
ARGUMENTS
request Specifies the bookcase in the bookcase descriptor field, as well as a valid value in the primary_oid, the secondary_oid, or the
sequence_num field. The primary_oid represents the DtInfo Database object identifier of the TOC section; the secondary_oid rep-
resents the object identifier of the book itself; and the sequence_num represents the sequence number of the book within the
bookcase (0 based). If more than one of these fields have a valid value, the order of precedence is: primary_oid, secondary_oid,
and, last, sequence_num.
length Specifies the variable to receive the length of the returned short title, if the returned pointer to the title is not NULL.
RETURN VALUE
If DtMmdbBookGetShortTitle completes successfully, it returns a pointer to the book's short title. If it fails, it returns a NULL pointer.
EXAMPLE
None.
SEE ALSO
DtMmdbBookGetLongTitle(3)
DtMmdbBookGetShortTitle(library call)