Sponsored Content
Top Forums Shell Programming and Scripting Rename file using partial match to another Post 303040312 by cmccabe on Saturday 26th of October 2019 11:33:31 AM
Old 10-26-2019
Here is what I get:


with echo mv
Code:
mv IonCode_0402_xxx.xxx_xxx.bam _test.bam
mv IonCode_0402_xxx.xxx_xxx.bam.bai _test.bam.bai
mv IonCode_0404_xxx.xxx_xxx.bam _test.bam
mv IonCode_0404_xxx.xxx_xxx.bam.bai _test.bam.bai

with mv
Code:
_test.bam
_test.bam.bai

Thank you Smilie.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk partial match and filter records

Hi, I am having file which contains around 15 columns, i need to fetch column 3,12,14 based on the condition that column 3 starts with 40464 this is the sample data how to achieve that (3 Replies)
Discussion started by: aemunathan
3 Replies

2. Shell Programming and Scripting

Using grep returns partial matches, I need to get an exact match or nothing

I’m trying to modify someone perl script to fix a bug. The piece of code checks that the zone name you want to add is unique. However, when the code runs, it finds a partial match using grep, and decides it already exists, so the “create” command exits. $cstatus = `${ZADM} list -vic | grep... (3 Replies)
Discussion started by: TKD
3 Replies

3. UNIX for Dummies Questions & Answers

Partial match in two files then substitute

Hi, I was trying to figure this out but failed so I hope someone here can help me, thank you in advance. I have two files. file1: aa M bb N cc O dd P ee Q file2: aa A_87_P254063 cc A_87_P016532 bb A_87_P104793 dd A_87_P055331 ee A_87_P059706 aa A_87_P071636 ee A_87_P028302... (2 Replies)
Discussion started by: yuejian
2 Replies

4. UNIX for Dummies Questions & Answers

How to substitute for the partial match?

Hi I have a question and hope I can get answer here. Thank you in advance. I have two files: file1: aa X bb Y cc Z file2: cc A bb B dd C aa D bb E If the 1st column match in both file1 and file2, the 2nd column in file2 will be replaced by the 2nd column in file1. If there is no... (2 Replies)
Discussion started by: yuejian
2 Replies

5. Shell Programming and Scripting

Match partial text

I posted the incorrect files yesterday and apologize. I also modified the awk script but with no luck. There are two text files in the zip (name.txt and output.txt). I am trying to match $2 in name.txt with $1 in output.txt and if they match then $1 of name.txt is copied to $7 of output.txt. ... (7 Replies)
Discussion started by: cmccabe
7 Replies

6. Shell Programming and Scripting

Rename specific file extension in directory with match to another file in bash

I have a specific set (all ending with .bam) of downloaded files in a directory /home/cmccabe/Desktop/NGS/API/2-15-2016. What I am trying to do is use a match to $2 in name to rename the downloaded files. To make things a more involved the date of the folder is unique and in the header of name... (1 Reply)
Discussion started by: cmccabe
1 Replies

7. Shell Programming and Scripting

Rename files to match file list pattern

Hi All, I have 100 folders with the first delimiter has a unique name i.e (123_hello and 575_hello) and each folder have atlist 1000 plus files with naming convention i.e (575_hello_1.iso ... 575_hello_1000.iso). 575_hello/575_hello_1.iso 575_hello/575_hello_2.iso 575_hello/575_hello_3.iso... (8 Replies)
Discussion started by: lxdorney
8 Replies

8. Shell Programming and Scripting

Partial Match and Replace

Hi, I have a tab delimited text file like this one. I need to do a partial match of a particular cell and then replace matches with an empty cell. So here is a sample: Smith FordMustang ChevroletCamaro Miller FordFiesta Jones KiaSorrento Davis ChevroletCamaro Johnson ToyotaHighlander I... (4 Replies)
Discussion started by: mikey11415
4 Replies

9. Shell Programming and Scripting

awk to update file based on partial match in field1 and exact match in field2

I am trying to create a cronjob that will run on startup that will look at a list.txt file to see if there is a later version of a database using database.txt as the source. The matching lines are written to output. $1 in database.txt will be in list.txt as a partial match. $2 of database.txt... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. Shell Programming and Scripting

Bash to rename portion of file using match to another

In the portion of bash below I am using rename to match the $id variable to $file and when a match (there will alwsys be one) is found then the $id is removed from each bam and bam.bai in $file and _test is added to thee file name before the extension. Each of the variables is set correctly but... (3 Replies)
Discussion started by: cmccabe
3 Replies
Config::BaseConfigurator(3)				User Contributed Perl Documentation			       Config::BaseConfigurator(3)

NAME
Log::Log4perl::Config::BaseConfigurator - Configurator Base Class SYNOPSIS
This is a virtual base class, all configurators should be derived from it. DESCRIPTION
METHODS "new" Constructor, typically called like my $config_parser = SomeConfigParser->new( file => $file, ); my $data = $config_parser->parse(); Instead of "file", the derived class "SomeConfigParser" may define any type of configuration input medium (e.g. "url => 'http://foobar'"). It just has to make sure its "parse()" method will later pull the input data from the medium specified. The base class accepts a filename or a reference to an array of text lines: "file" Specifies a file which the "parse()" method later parses. "text" Specifies a reference to an array of scalars, representing configuration records (typically lines of a file). Also accepts a simple scalar, which it splits at its newlines and transforms it into an array: my $config_parser = MyYAMLParser->new( text => ['foo: bar', 'baz: bam', ], ); my $data = $config_parser->parse(); If either "file" or "text" parameters have been specified in the constructor call, a later call to the configurator's "text()" method will return a reference to an array of configuration text lines. This will typically be used by the "parse()" method to process the input. "parse" Virtual method, needs to be defined by the derived class. Parser requirements o If the parser provides variable substitution functionality, it has to implement it. o The parser's "parse()" method returns a reference to a hash of hashes (HoH). The top-most hash contains the top-level keywords ("category", "appender") as keys, associated with values which are references to more deeply nested hashes. o The "log4perl." prefix (e.g. as used in the PropertyConfigurator class) is stripped, it's not part in the HoH structure. o Each Log4perl config value is indicated by the "value" key, as in $data->{category}->{Bar}->{Twix}->{value} = "WARN, Logfile" EXAMPLES The following Log::Log4perl configuration: log4perl.category.Bar.Twix = WARN, Screen log4perl.appender.Screen = Log::Log4perl::Appender::File log4perl.appender.Screen.filename = test.log log4perl.appender.Screen.layout = Log::Log4perl::Layout::SimpleLayout needs to be transformed by the parser's "parse()" method into this data structure: { appender => { Screen => { layout => { value => "Log::Log4perl::Layout::SimpleLayout" }, value => "Log::Log4perl::Appender::Screen", }, }, category => { Bar => { Twix => { value => "WARN, Screen" } } } } For a full-fledged example, check out the sample YAML parser implementation in "eg/yamlparser". It uses a simple YAML syntax to specify the Log4perl configuration to illustrate the concept. SEE ALSO
Log::Log4perl::Config::PropertyConfigurator Log::Log4perl::Config::DOMConfigurator Log::Log4perl::Config::LDAPConfigurator (tbd!) COPYRIGHT AND LICENSE
Copyright 2002-2009 by Mike Schilli <m@perlmeister.com> and Kevin Goess <cpan@goess.org>. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.1 2010-02-07 Config::BaseConfigurator(3)
All times are GMT -4. The time now is 12:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy