Sponsored Content
Full Discussion: finding, copying, assembling
Top Forums UNIX for Dummies Questions & Answers finding, copying, assembling Post 302597689 by JDenton on Saturday 11th of February 2012 12:09:51 PM
Old 02-11-2012
Question finding, copying, assembling

Hi everybody,

I've been running some analyses, the results of which have been stored in a sequential manner with a directory structure like step0, step1, step2, ... for iterations 0-2, for example. Each iteration contains several nested folders, with three pieces of information I need. I need to do the following:

(1) Find within each iteration directory, and extract sequentially to a new file, the number following the text, "final GAMMA-based Likelihood:" The numbers need to be in a list whose order preserves the original order (iteration 0, 1, 2, ...).

(2) Find, copy, and concatenate into a single file the contents of the file "RAxML_bestTree.default." As for (1), the order should preserve the iteration order.

(3) Copy the file "input.phy" to a new directory called alignments, preserving the order of the iterations, and renaming the file to correspond to the iteration number, e.g. input.phy.0, inpout.phy.1, etc.

I anticipate this will require some grep and for loops, but I am very much unsure of how to proceed.

Thanks!

~John
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

finding and copying files !

Hi , I have a question relating to finding and copying files. i need to find the .pdf files from the specified directory which has subdirectories too. I only need .pdf files and not the directories and need to copy those files into my current directory. copy files from :... (5 Replies)
Discussion started by: bregoty
5 Replies

2. Shell Programming and Scripting

script for Finding files in a folder and copying to another folder

Hi all, I have a folder '/samplefolder' in which i have some files like data0.txt, data1.txt and data2.txt. I have to search the folder for existence of the file data0.txt first and if found have to copy it to some other file; next i have to search the folder for existence of file... (5 Replies)
Discussion started by: satish2712
5 Replies

3. Shell Programming and Scripting

Help assembling script

I am trying to figure out how to write a bash script to process a file in order to make it more user readable. The file to be processed is quite uniform, every line starts with a 32 bit Unix timestamp in hexadecimal format, then a single tab charcter (0x09) then a string of text. What I want to... (1 Reply)
Discussion started by: stumpyuk
1 Replies

4. UNIX for Dummies Questions & Answers

Finding and Copying Email

I have to create a bash script that will find Feedback emails and copy them to a labFeedback folder in my mail directory. I have an idea in my head on what commands can be used for this (find obviously among them). However, I have no idea where to start. I'm not sure what info needs to be given,... (1 Reply)
Discussion started by: Joesgrrrl
1 Replies

5. Shell Programming and Scripting

Finding & Copying files

Hello :) can someone please help me with this task: I am in the shell, in folder "Main" below the folder Main are sub folders: "sourceA", "Source B", and "target" in sourceA and source B are files, and in folder "Main" is a textfile, with filenames, one filename per line. I need a... (4 Replies)
Discussion started by: Y-T
4 Replies

6. UNIX for Dummies Questions & Answers

Finding duplicates then copying, almost there, maybe?

Hi everyone. I'm trying to help my wife with a project, she has exported 200 images from many different folders, unfortunately there was a problem with the export and I need to find the master versions so that she doesn't have to go through and select them again. I need to: For each image in... (2 Replies)
Discussion started by: Rhinoskin
2 Replies

7. Shell Programming and Scripting

Assembling the Pieces of a Regular Expression

Hello all. I'm scripting in ksh and trying to put together a regular expression. I think my logic is sound, but I'm doing the head-against-the-wall routine while trying to put the individual pieces together. Can anybody lend some suggestions to the below problem? I'm taking a date in the... (2 Replies)
Discussion started by: Michael_K
2 Replies

8. UNIX for Advanced & Expert Users

Challenges in finding and copying the block

Hi, I have a below challenging task where iam unable to find the block and copy the same into a file. I tried my luck,howver iam unable to reach the first and second step..Can anyone help me with a clue or with the commands so that i can give a try. 1. search the <number>9966993366</number>... (2 Replies)
Discussion started by: cskumar
2 Replies

9. Shell Programming and Scripting

Need help in finding and copying list of files using bash shell script

Dear All, I have a situation where I want to copy some files of type .txt. These files are o/p from one program. Some of the files are named as fileName .txt instead of fileName.txt after fileName by mistake I have specified "space". Now I want to move these files as follows. mv fileName*... (13 Replies)
Discussion started by: linuxUser_
13 Replies

10. UNIX for Dummies Questions & Answers

Matching string and assembling

I have been thinking how to address this particular task but is way beyond my knowledge. I have a reference sequence, something like this: >Reference AGAGAGACCTGGAGAGAGAGTGACGATGAGCAGTGACGATGACGTACGATAGCAGTAGACGCA and a input.txt file with thousand of short sequences, something like this ... (4 Replies)
Discussion started by: Xterra
4 Replies
DTRX(1) 																   DTRX(1)

NAME
dtrx - cleanly extract many archive types SYNOPSIS
dtrx [OPTIONS] ARCHIVE [ARCHIVE ...] DESCRIPTION
dtrx extracts archives in a number of different formats; it currently supports tar, zip (including self-extracting .exe files), cpio, rpm, deb, gem, 7z, cab, rar, and InstallShield files. It can also decompress files compressed with gzip, bzip2, lzma, or compress. In addition to providing one command to handle many different archive types, dtrx also aids the user by extracting contents consistently. By default, everything will be written to a dedicated directory that's named after the archive. dtrx will also change the permissions to ensure that the owner can read and write all those files. To run dtrx, simply call it with the archive(s) you wish to extract as arguments. For example: $ dtrx coreutils-5.*.tar.gz OPTIONS
dtrx supports a number of options to mandate specific behavior: -r, --recursive With this option, dtrx will search inside the archives you specify to see if any of the contents are themselves archives, and extract those as well. --one, --one-entry Normally, if an archive only contains one file or directory with a name that doesn't match the archive's, dtrx will ask you how to handle it. With this option, you can specify ahead of time what should happen. Possible values are: inside Extract the file/directory inside another directory named after the archive. This is the default. rename Extract the file/directory in the current directory, and then rename it to match the name of the archive. here Extract the file/directory in the current directory. -o, --overwrite Normally, dtrx will avoid extracting into a directory that already exists, and instead try to find an alternative name to use. If this option is listed, dtrx will use the default directory name no matter what. -f, --flat Extract all archive contents into the current directory, instead of their own dedicated directory. This is handy if you have multi- ple archive files which all need to be extracted into the same directory structure. Note that existing files may be overwritten with this option. -n, --noninteractive dtrx will normally ask the user how to handle certain corner cases, such as how to handle an archive that only contains one file. This option suppresses those questions; dtrx will instead use sane, conservative defaults. -l, -t, --list, --table Don't extract the archives; just list their contents on standard output. -m, --metadata Extract the metadata from .deb and .gem archives, instead of their normal contents. -q, --quiet Suppress warning messages. Listing this option twice will cause dtrx to be silent. -v, --verbose Show the files that are being extracted. Listing this option twice will cause dtrx to print debugging information. --help Display basic help. --version Display dtrx's version, copyright, and license information. AUTHOR
Brett Smith <brettcsmith@brettcsmith.org> COPYRIGHT
dtrx 6.5 is copyright (C) 2006-2009 Brett Smith and others. Feel free to send comments, bug reports, patches, and so on. You can find the latest version of dtrx on its home page at <http://www.brettcsmith.org/2007/dtrx/>. dtrx is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. 6.5 2009-07-04 DTRX(1)
All times are GMT -4. The time now is 02:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy