Sponsored Content
Top Forums Shell Programming and Scripting Sorting and moving file sequence with gaps Post 302534741 by DGPickett on Tuesday 28th of June 2011 03:42:13 PM
Old 06-28-2011
Sure, ksh/bash not sed can do same:
Code:
find ... -name AAAA_*00.jpg | while read f
do
 mkdir ${f%.jpg}
 mv ${f%00.jpg}*.jpg ${f%.jpg}/
done

More speed?
Code:
find ... -name AAAA_*00.jpg | sed 's/\.jpg$//' | xargs -n999 mkdir
find ... -name AAAA_*00.jpg | sed 's/\(\(.*\)00\)\.jpg$/mv \2*.jpg \1/' | sh

 

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
SEQNR(1e)						     EMBOSS Manual for Debian							 SEQNR(1e)

NAME
seqnr - Removes redundancy from DHF files. SYNOPSIS
seqnr -dhfinpath dirlist -dosing toggle -singletsdir directory -dosets toggle -insetsdir directory [-matrix matrixf] -mode list -thresh float -threshlow float -threshup float [-gapopen float] [-gapextend float] -dhfoutdir outdir -dored toggle -redoutdir outdir -logfile outfile seqnr -help DESCRIPTION
seqnr 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 -dhfinpath dirlist This option specifies the location of DHF files (domain hits files) (input). A 'domain hits file' contains database hits (sequences) with domain classification information, in the DHF format (FASTA or EMBL-like). The hits are relatives to a SCOP or CATH family and are found from a search of a sequence database. Files containing hits retrieved by PSIBLAST are generated by using SEQSEARCH. Default value: ./ -dosing toggle This option specifies whether to use singlet sequences (e.g. DHF files) to filter input. Optionally, up to two further directories of sequences may be read: these are considered in the redundancy calculation but never appear in the output files. Default value: Y -singletsdir directory This option specifies the location of singlet filter sequences (e.g. DHF files) (input). A 'domain hits file' contains database hits (sequences) with domain classification information, in the DHF format (FASTA or EMBL-like). The hits are relatives to a SCOP or CATH family and are found from a search of a sequence database. Files containing hits retrieved by PSIBLAST are generated by using SEQSEARCH. Default value: ./ -dosets toggle This option specifies whether to use sets of sequences (e.g. DHF files) to filter input. Optionally, up to two further directories of sequences may be read: these are considered in the redundancy calculation but never appear in the output files. Default value: Y -insetsdir directory This option specifies location of sets of filter sequences (e.g. DAF files) (input). A 'domain alignment file' contains a sequence alignment of domains belonging to the same SCOP or CATH family. The file is in clustal format annotated with domain family classification information. The files generated by using SCOPALIGN will contain a structure-based sequence alignment of domains of known structure only. Such alignments can be extended with sequence relatives (of unknown structure) by using SEQALIGN. Default value: ./ -matrix matrixf This option specifies the residue substitution matrix that is used for sequence comparison. Default value: EBLOSUM62 Required section -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 set of input sequences 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 -thresh float This option specifies the % sequence identity redundancy threshold. The % sequence identity redundancy threshold 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 (lower limit). The % sequence identity redundancy threshold 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 (upper limit). The % sequence identity redundancy threshold 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. The gap insertion penalty 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. The gap extension, penalty 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 Output section -dhfoutdir outdir This option specifies the location of DHF files (domain hits files) of non-redundant sequences (output). A 'domain hits file' contains database hits (sequences) with domain classification information, in the DHF format (FASTA or EMBL-like). The hits are relatives to a SCOP or CATH family and are found from a search of a sequence database. Files containing hits retrieved by PSIBLAST are generated by using SEQSEARCH. Default value: ./ -dored toggle This option specifies whether to retain redundant sequences. If this option is set a DHF file (domain hits file) of redundant sequences is written. Default value: N -redoutdir outdir This option specifies the location of DHF files (domain hits files) of redundant sequences (output). A 'domain hits file' contains database hits (sequences) with domain classification information, in the DHF format (FASTA or EMBL-like). The hits are relatives to a SCOP or CATH family and are found from a search of a sequence database. Files containing hits retrieved by PSIBLAST are generated by using SEQSEARCH. Default value: ./ -logfile outfile This option specifies the name of SEQNR log file (output). The log file contains messages about any errors arising while SEQNR ran. Default value: seqnr.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
seqnr 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. DOMSEARCH 0.1.0++20100721 08/11/2010 SEQNR(1e)
All times are GMT -4. The time now is 11:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy