Sponsored Content
Top Forums Shell Programming and Scripting Sorting and moving file sequence with gaps Post 302534689 by ex_H on Tuesday 28th of June 2011 01:25:36 PM
Old 06-28-2011
Sorting and moving file sequence with gaps

Hello,

I have lots of sequentially numbered files which make up an image sequence.

I'm trying to do two things with it:

#1: Find gaps in the sequence and move each range of sequencial files into their own subfolder.

#2: Designate a starting point (file) and move every 24th file into another subfolder.

The files are named like this:

AAAA_000001
AAAA_000002
... (continuous)
AAAA_120001
AAAA_120002
AAAA_125000 (sequence break)
AAAA_125001
... (continuous)
AAAA_150001
AAAA_150002
etc...

I figure the best is to put it into two scripts, but I'm can't find a good starting point for either task. I don't know how to identify the range of the sequence so I can make a list to move the files.

Any ideas?


Many thanks
 

8 More Discussions You Might Find Interesting

1. Linux

Searching for gaps in huge (2.2G) log file?

I've got a 2.2 Gig syslog file from our Cisco firewall appliance. The problem is that we've been seeing gaps in the syslog for anywhere from 10 minutes to 2 hours. Currently I've just been using 'less' and paging through the file to see if I can find any noticeable gaps. Obviously this isn't the... (3 Replies)
Discussion started by: deckard
3 Replies

2. Shell Programming and Scripting

Sorting Files by date and moving files in date order

I need to build a k shell script that will sort files in a directory where files appear like this "XXXX_2008021213.DAT. I need to sort by date in the filename and then move files by individual date to a working folder. concatenate the files in the working folder then start a process once... (2 Replies)
Discussion started by: rebel64
2 Replies

3. Shell Programming and Scripting

Finding & Moving Oldest File by Parsing/Sorting Date Info in File Names

I'm trying to write a script that will look in an /exports folder for the oldest export file and move it to a /staging folder. "Oldest" in this case is actually determined by date information embedded in the file names themselves. Also, the script should only move a file from /exports to... (6 Replies)
Discussion started by: nikosey
6 Replies

4. UNIX for Advanced & Expert Users

help with sorting sequence in Unix C:sort -t ':' +0 -1 -n +1 -2 +2 -3 -o list list

Hi List is 000|2008-07-17|556543|RTJ|35-RTGJ|EYT 465|2008-11-10|567789|GHJ|45-DGHH|ETU 533|2008-09-06|567789|GHJ|45-DGHH|ETU How does it do it? sort -t ':' +0 -1 -n +1 -2 +2 -3 -o list list (6 Replies)
Discussion started by: gurvinder
6 Replies

5. Shell Programming and Scripting

Searching for Gaps in Time

I am very new to shell scripting. We use C-Shell here and I know the issues that surround it. I hope a solution can be created using awk, sed, etc... instead of having to write a program. I have an input file that is sorted by date and time in ascending order ... (2 Replies)
Discussion started by: jclanc8
2 Replies

6. Shell Programming and Scripting

find common entries and match the number with long sequence and cut that sequence in output

Hi all, I have a file like this ID 3BP5L_HUMAN Reviewed; 393 AA. AC Q7L8J4; Q96FI5; Q9BQH8; Q9C0E3; DT 05-FEB-2008, integrated into UniProtKB/Swiss-Prot. DT 05-JUL-2004, sequence version 1. DT 05-SEP-2012, entry version 71. FT COILED 59 140 ... (1 Reply)
Discussion started by: manigrover
1 Replies

7. Shell Programming and Scripting

Adding gaps to a string in bash

I have the following string, and want to introduce additional spaces between the two %s. This will be done by specifying the gap between the %s. Example having gap=8 will put 8 spaces between the two %s. frmt_k1d1_test="%s %s\n" I am doing the script in bash. ---------- Post updated at... (4 Replies)
Discussion started by: kristinu
4 Replies

8. UNIX for Dummies Questions & Answers

Gaps and frequencies

I have this infile: >GHL8OVD01BNNCA Freq 10 TAGATGTGCCCGTGGGTTTCCCGTCAACACCGGATAGT-GCAGCA-TA >GHL8OVD01CMQVT Freq 1 TTGATGTCGTGGGTTTCCCGTCAACACCGGCAAATAGT-GCAGCA-TA >GHL8OVD01CMQVT Freq 1 TTGATGTGCCAGTTTCCCGTCTAGCAGCACTACCAGGACCTTCGC-TA >GHL8OVD01CMQVW Freq 1... (1 Reply)
Discussion started by: Xterra
1 Replies
DOMAINNR(1e)						     EMBOSS Manual for Debian						      DOMAINNR(1e)

NAME
domainnr - Removes redundant domains from a DCF file. SYNOPSIS
domainnr -dcfinfile infile [-datafile matrixf] -retain toggle -node list -mode list -threshold float -threshlow float -threshup float [-gapopen float] [-gapextend float] -dcfoutfile outfile -redoutfile outfile -logfile outfile domainnr -help DESCRIPTION
domainnr is a command line program from EMBOSS ("the European Molecular Biology Open Software Suite"). It is part of the "Utils:Database creation" command group(s). OPTIONS
Input section -dcfinfile infile This option specifies name of DCF file (domain classification file) (input). A 'domain classification file' contains classification and other data for domains from SCOP or CATH, in DCF format (EMBL-like). The files are generated by using SCOPPARSE and CATHPARSE. Domain sequence information can be added to the file by using DOMAINSEQS. -datafile matrixf This option specifies the residue substitution matrix. This is used for sequence comparison. Default value: EBLOSUM62 -retain toggle This option specifies whether to write redundant domains to a separate file. If this option is selected, redundant domains are written to a separate output file. Default value: N Required section -node list This option specifies the node for redundancy removal. Redundancy can be removed at any specified node in the SCOP or CATH hierarchies. For example by selecting 'Class' entries belonging to the same Class will be non-redundant. Default value: 1 -mode list This option specifies whether to remove redundancy at a single threshold % sequence similarity or remove redundancy outside a range of acceptable threshold % similarity. All permutations of pair-wise sequence alignments are calculated for each domain family in turn using the EMBOSS implementation of the Needleman and Wunsch global alignment algorithm. Redundant sequences are removed in one of two modes as follows: (i) If a pair of proteins achieve greater than a threshold percentage sequence similarity (specified by the user) the shortest sequence is discarded. (ii) If a pair of proteins have a percentage sequence similarity that lies outside an acceptable range (specified by the user) the shortest sequence is discarded. Default value: 1 -threshold float This option specifies the % sequence identity redundancy threshold, which determines the redundancy calculation. If a pair of proteins achieve greater than this threshold the shortest sequence is discarded. Default value: 95.0 -threshlow float This option specifies the % sequence identity redundancy threshold, which determines the redundancy calculation. If a pair of proteins have a percentage sequence similarity that lies outside an acceptable range the shortest sequence is discarded. Default value: 30.0 -threshup float This option specifies the % sequence identity redundancy threshold, which determines the redundancy calculation. If a pair of proteins have a percentage sequence similarity that lies outside an acceptable range the shortest sequence is discarded. Default value: 90.0 Additional section -gapopen float This option specifies the gap insertion penalty. This is the score taken away when a gap is created. The best value depends on the choice of comparison matrix. The default value assumes you are using the EBLOSUM62 matrix for protein sequences, and the EDNAFULL matrix for nucleotide sequences. Default value: 10 -gapextend float This option specifies the gap extension penalty. This is added to the standard gap penalty for each base or residue in the gap. This is how long gaps are penalized. Usually you will expect a few long gaps rather than many short gaps, so the gap extension penalty should be lower than the gap penalty. Default value: 0.5 Advanced section Output section -dcfoutfile outfile This option specifies the name of non-redundant DCF file (domain classification file) (output). A 'domain classification file' contains classification and other data for domains from SCOP or CATH, in DCF format (EMBL-like). The files are generated by using SCOPPARSE and CATHPARSE. Domain sequence information can be added to the file by using DOMAINSEQS. Default value: test.scop -redoutfile outfile This option specifies the name of DCF file (domain classification file) for redundant sequences (output). A 'domain classification file' contains classification and other data for domains from SCOP or CATH, in DCF format (EMBL-like). The files are generated by using SCOPPARSE and CATHPARSE. Domain sequence information can be added to the file by using DOMAINSEQS. -logfile outfile This option specifies the name of log file for the build. The log file contains messages about any errors arising while domainnr ran. Default value: domainnr.log BUGS
Bugs can be reported to the Debian Bug Tracking system (http://bugs.debian.org/emboss), or directly to the EMBOSS developers (http://sourceforge.net/tracker/?group_id=93650&atid=605031). SEE ALSO
domainnr is fully documented via the tfm(1) system. AUTHOR
Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org> Wrote the script used to autogenerate this manual page. COPYRIGHT
This manual page was autogenerated from an Ajax Control Definition of the EMBOSS package. It can be redistributed under the same terms as EMBOSS itself. DOMAINATRIX 0.1.0+20100721 08/11/2010 DOMAINNR(1e)
All times are GMT -4. The time now is 05:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy