detecting consecutive filenames


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers detecting consecutive filenames
# 1  
Old 11-10-2009
detecting consecutive filenames

I have a series of filenames of the format junk_x_###.txt where x and ### are numbers. I need to detect when at least 30 consecutive files (e.g. junk_1_001.txt, junk_1_002.txt.....) are in the directory. There are sets of files with similar names that need to be grouped together and counted separately (e.g. junk_2_001.txt..., junk_3_001.txt....) and whichever cluster has more than 30 selected. I also need to allow for the consecutive filenames not beginning at 001 (e.g. junk_1_100.txt, junk_1_101.txt.....).

In essence I need to identify 30 consecutive files with identical filenames as far as junk_x_
What is the best strategy to take here? I'm trying to cluster the root of each filename, list them and then pipe to wc -l to count them but not getting the initial clustering to work well. Any suggestions for this step?
thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need help in detecting errors

Hi All , I need a script to find errors in a particular and in a particular path Actually in my logs i`ve so many kinds of errors(i can even say as 100 types also).if i run the script i need to know the error (some errors can aviod ) so finally the script o/p should be a numeric... (3 Replies)
Discussion started by: radha254
3 Replies

2. Shell Programming and Scripting

detecting the part of a filename

I like to have the date in the 2008-09-01 format at the beginning of my filenames. I then hyphenate after that and then have my filename. I have a script that creates this for me. However, I may be working on files that already have the date format already in there and so I don't want to have a... (4 Replies)
Discussion started by: mainegate
4 Replies

3. Programming

Detecting interruptions in C

Hi. You may know how to detect when a interruption succeeded programming in C. Just like receiving a signal without blocking. Knowing when it was a keystroke (IRQ 2), or a mouse movement (12), or a disk access, etc. and getting actually for example the letter typed. Thanks a lot. (7 Replies)
Discussion started by: Ashrentum
7 Replies

4. UNIX for Dummies Questions & Answers

Detecting Second disk

Hello all, first of all, I apologise if I may ask stupid or obvious questions, but I'm new to UNIX and I think I need a little bit of help before I start gearing up :) Anyway, I have installed a Solaris 8 on a Sun machine, and it has 2 physical disks in it. However, it seems that it is only... (7 Replies)
Discussion started by: dragunu
7 Replies

5. Programming

Detecting a key combination

Could anybody tell me how I can detect a particular key combination and perform a particular task on that event. e.g. if I press Ctrl + L on the shell then it clears the screen. Please tell me how it can be performed on my shell. And how the Arrow Keys can be detected. I tried but pressing a key... (11 Replies)
Discussion started by: mobile01
11 Replies

6. Gentoo

Not detecting CD ROm drive

Hello All, I am pretty new to Linux, When trying to install TurboLinux 6.0 through a boot floppy, After a while it says to insert the CD and later it is not recognizing the CDROM, SO do we need to mount the CD-ROM before installation ?? Thanks in Advance :) S (13 Replies)
Discussion started by: sbasetty
13 Replies

7. Shell Programming and Scripting

detecting login or logout

what function would tell me that a user has logged in or out? i already know from my script the users name i already know in real time there was an event how an I tell if that event was a login or logout? Any ideas? # i did try comparing the file sizes for change but various users may... (8 Replies)
Discussion started by: nortypig
8 Replies

8. IP Networking

Detecting NIC in Solaris10

I have an E420 server that has a TPE Slot / NIC installed. However there is no interface file installed eg /etc/hostname.hme0 or equivalent. I have placed a private ip entry int the hosts file to accompany the loop back entry i.e. 127.0.0.1 localhost 172.16.0.10 loghost se420 ... (1 Reply)
Discussion started by: jimthompson
1 Replies

9. UNIX for Advanced & Expert Users

Detecting NIC in Solaris10

I have an E420 server that has a TPE Slot / NIC installed. However there is no interface file installed eg /etc/hostname.hme0 or equivalent. I have placed a private ip entry int the hosts file to accompany the loop back entry i.e. 127.0.0.1 localhost 172.16.0.10 loghost se420 ... (1 Reply)
Discussion started by: jimthompson
1 Replies

10. UNIX for Dummies Questions & Answers

detecting drives

I know that Unix is different from windows in that it needs more manual configuring but how do I get Solaris 8 (Intel version) to recognize my floppy drive and cd-rom?? I mean does it automatically detect the drives at startup and I have to mount them or do I have to create the drives somehow and... (1 Reply)
Discussion started by: eloquent99
1 Replies
Login or Register to Ask a Question
GOPEN(1)						       GNUstep System Manual							  GOPEN(1)

NAME
gopen - open files SYNOPSIS
gopen [-a application] [-o] [-p] [-NXHost hostname] [filename] DESCRIPTION
The gopen command allows you open a file (or directory) as if you had double clicked the object's icon. It is possible to specify one or more filenames which are interpreted relative to the current working directory. By default, gopen will open filename with the application currently assigned to the file's extension. But by specifing the -a flag on the command line you can tell gopen to open the file with another application. You can also directly print a file without ( -p ) or with ( -p -o ) opening it. As with most other GNUstep software, it is easily possible to attach the process to a remote window server using the -NXHost flag. OPTIONS
-a application use application to open filename -o open filename (may be used in conjunction with -p ). -p print filename instead of opening. -NXHost hostname attach to remote window server on hostname EXAMPLES
Open all files with a .txt extension in the current directory: gopen *.txt To open a source file in CodeEditor (instead of the current default application), type: gopen -a CodeEditor MySourceFile.m To print the .plan file in your home folder, use the -p flag: gopen -p ~/.plan BUGS
Using the -a application argument, gopen allows you to open any kind of file with any application you want. This does, however, not work with applications employing the NSDocument architecture as they will only receive filenames whose types the application has registered. To circumvent this limitation, applications may advertise their ability to open all kinds of files through the "*" filetype. When gopen is used with only the -a application argument but no filename present, the application is simply launched without opening a specific file. SEE ALSO
GNUstep(7), openapp(1) HISTORY
gopen was written November 2001. This manual page was first written July 2003. AUTHORS
gopen was written by Gregory Casamento <greg_casamento@yahoo.com>. This man page was written by Martin Brecher <martin@mb-itconsulting.com>. GNUstep August 2003 GOPEN(1)