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
SMP_REP_ROUTE_INFO(8)						     SMP_UTILS						     SMP_REP_ROUTE_INFO(8)

NAME
smp_rep_route_info - invoke REPORT ROUTE INFORMATION SMP function SYNOPSIS
smp_rep_route_info [--help] [--hex] [--index=IN] [--interface=PARAMS] [--multiple] [--num=NUM] [--phy=ID] [--raw] [--sa=SAS_ADDR] [--ver- bose] [--version] [--zero] SMP_DEVICE[,N] DESCRIPTION
Sends a SAS Management Protocol (SMP) REPORT ROUTE INFORMATION function request to a SMP target. The SMP target is identified by the SMP_DEVICE and the SAS_ADDR. Depending on the interface, the SAS_ADDR may be deduced from the SMP_DEVICE. The mpt interface uses SMP_DEVICE to identify a HBA (an SMP initiator) and needs the additional ,N to differentiate between HBAs if there are multiple present. There are two expander route table types: phy-based and expander-based. The expander-based route table was introduced in SAS-2 and super- sedes the phy-based route tables. The REPORT ROUTE INFORMATION function is associated with a phy-based route table. The CONFIGURE ROUTE INFORMATION function is provided to manually set up a phy-based route table. Each phy in a SAS expander that has an associated routing attribute of "table" has a router table. The number of rows (or entries) in each router table is given by the "expander route indexes" field in the response of the REPORT GENERAL function. When the --multiple option is given, the REPORT ROUTE INFORMATION function is called multiple times. The index value increments on each iteration, starting from --index=IN (default 0). If --num=NUM is given and NUM is greater than zero then that is the maximum number of iterations performed. If --num=NUM is not given (or NUM is zero) then iterations continue until there are 4 adjacent disabled route entries (or some error is detected). OPTIONS
Mandatory arguments to long options are mandatory for short options as well. -h, --help output the usage message then exit. -H, --hex output the response (less the CRC field) in hexadecimal. -i, --index=IN expander route index. IN is a value between 0 and 65535. Default is 0. More precisely the maximum index value is (expander_route_indexes - 1). -I, --interface=PARAMS interface specific parameters. In this case "interface" refers to the path through the operating system to the SMP initiator. See the smp_utils man page for more information. -m, --multiple call the REPORT ROUTE INFORMATION function multiple times, starting at --index=IN, incrementing the index value on each iteration for a maximum of --num=NUM iterations. For each enabled route table entry, one line is output. If --num=NUM is not given (or NUM is zero) then iterations continue until 4 adjacent disabled entries are found (or some error occurs). -n, --num=NUM used with --multiple option to specify the maximum number of iterations. -p, --phy=ID phy identifier. ID is a value between 0 and 254. Default is 0. -r, --raw send the response (less the CRC field) to stdout in binary. All error messages are sent to stderr. -s, --sa=SAS_ADDR specifies the SAS address of the SMP target device. Typically this is an expander. This option may not be needed if the SMP_DEVICE has the target's SAS address within it. The SAS_ADDR is in decimal but most SAS addresses are shown in hexadecimal. To give a number in hexadecimal either prefix it with '0x' or put a trailing 'h' on it. -v, --verbose increase the verbosity of the output. Can be used multiple times. -V, --version print the version string and then exit. -z, --zero zero the Allocated Response Length field in the request. This option also zeros the Request Length field in the request. This is required for strict SAS-1.1 compliance. However this option should not be given in SAS-2 and later; if it is given an abridged response may result. CONFORMING TO
The SMP REPORT ROUTE INFORMATION function was introduced in SAS-1 . The "Expander change count" field was added in SAS-2 . AUTHORS
Written by Douglas Gilbert. REPORTING BUGS
Report bugs to <dgilbert at interlog dot com>. COPYRIGHT
Copyright (C) 2006-2011 Douglas Gilbert This software is distributed under a FreeBSD license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- POSE. SEE ALSO
smp_utils, smp_rep_general(smp_utils) smp_utils-0.96 May 2011 SMP_REP_ROUTE_INFO(8)
All times are GMT -4. The time now is 03:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy