Sponsored Content
Full Discussion: Find & Replace
Top Forums UNIX for Dummies Questions & Answers Find & Replace Post 302742773 by rob171171 on Tuesday 11th of December 2012 02:18:59 PM
Old 12-11-2012
Find & Replace

Hi
I am looking to rename the contents of this dir, each one with a new timestamp, interval of a second for each so it the existing format is on lhs and what I want is to rename each of these to what is on rhs..hopefully it nake sense

Code:
CDR.20060505.150006.gb    CDR.20121211.191500.gb
CDR.20060505.150109.gb    CDR.20121211.191501.gb
CDR.20060505.150216.gb    CDR.20121211.191502.gb
CDR.20060505.150308.gb    CDR.20121211.191503.gb

Hopefully this makes sense.
I know I need to utilise a sed command in conjunction with some sort of loop

Last edited by rob171171; 12-11-2012 at 03:20 PM.. Reason: more detail
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find & Replace

I get a text file with 70+ columns (seperated by Tab) and about 10000 rows. The 58th Column is all numbers. But sometimes 58th columns has "/xxx=##" after the numeric data. I want to truncate this string using the script. Any Ideas...:confused: (3 Replies)
Discussion started by: gagansharma
3 Replies

2. UNIX for Dummies Questions & Answers

improving my script (find & replace)

Hi all, I have a script that scan files, find old templet and replace it with new one. #!/bin/ksh file_name=$1 old_templet=$2 new_templet=$3 # Loop through every file like this for file in file_name do cat $file | sed "s/old_templet/new_templet/g" > $file.new #do a global searce and... (8 Replies)
Discussion started by: amir_yosha
8 Replies

3. Shell Programming and Scripting

find & incremental replace?

Looking for a way using sed/awk/perl to replace port numbers in a file with an incrementing number. The original file looks like... Host cmg-iqdrw3p4 LocalForward *:9043 localhost:9043 Host cmg-iqdro3p3a LocalForward *:10000 localhost:10000 Host cmg-iqdro3p3b LocalForward... (2 Replies)
Discussion started by: treadwm
2 Replies

4. UNIX for Dummies Questions & Answers

Find, Replace & Edit a string?

Is this something SED would be used for or can AWK do it? I have a string that I would like to chop bits out of and re-arrange some of the rest. Basically I want to change this: <log4j:event logger="webserver" timestamp="1240110840109" time="Sun Apr 19 04:14:00 BST 2009" level="INFO"... (4 Replies)
Discussion started by: Sepia
4 Replies

5. Shell Programming and Scripting

find & replace with user input

Trying to create a script/executable to replace "abc" text string in "myfile.htm" with input from a pop-up field. For example, launch this thing and a prompt is popped up asking the user to input what "abc" should be replaced with, then it inserts what the user inputs in place of abc in the... (3 Replies)
Discussion started by: mike909
3 Replies

6. Shell Programming and Scripting

Find & Replace string in multiple files & folders using perl

find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g' this is simple logic to find and replace in multiple files & folders Hope this helps. Thanks Zaheer (0 Replies)
Discussion started by: Zaheer.mic
0 Replies

7. Shell Programming and Scripting

Find & replace --> create a new file

Hi All, I have a unix shell script file as below. My task is a)to replace 248 to 350 and need to create a new file as BW3_350.sh b)to replace 248 to 380 and need to create a new file as BW3_380.sh c)to replace 248 to 320 and need to create a new file as BW3_320.sh there is no... (6 Replies)
Discussion started by: karthi_mrkg
6 Replies

8. UNIX for Dummies Questions & Answers

GREP Find & Replace <p class>

I am making an eBook. I am editing the html in BBedit. I need to replace all <p class="s5"> with just a <p>. How do I write this for GREP? Thank you, Abby (5 Replies)
Discussion started by: cuddlykitty
5 Replies

9. UNIX for Dummies Questions & Answers

Perl find & replace - what am I doing wrong?

Hi! I have a directory full of .plist type files from which I need to delete a line. Not every file contains the line, but of course I'd like to do it recursively. The line which I want to delete is: <string>com.apple.PhotoBooth</string> and looks like this in its native habitat: ... (9 Replies)
Discussion started by: sudon't
9 Replies

10. UNIX for Dummies Questions & Answers

Find & Replace with same case letters

I have text with upper and lower case words. I want to find something and replace it with something new. But it should match the case - Meaning - it should replace old upper cased word with NEW upper case word and lower with lower. example: this text is very simple TEXT. now I want to replace... (5 Replies)
Discussion started by: grep_me
5 Replies
PACPL(1)						User Contributed Perl Documentation						  PACPL(1)

NAME
pacpl - Perl Audio Converter, a multi purpose converter/ripper/tagger SYNOPSIS
pacpl --to <format> <options> [file(s)/directory(s)] DESCRIPTION
Perl Audio Converter is a tool for converting multiple audio types from one format to another. It supports AAC, AC3, AIFF, APE, AU, AVR, BONK, CAF, CDR, FAP, FLA, FLAC, IRCAM, LA, LPAC, MAT, MAT4, MAT5, M4A, MMF, MP2, MP3, MP4, MPC, MPP, NIST, OFR, OFS, OGG, PAC, PAF, PVF, RA, RAM, RAW, SD2, SF, SHN, SMP, SND, SPX, TTA, VOC, W64, WAV, WMA, and WV. It can also convert audio from the following video extensions: RM, RV, ASF, DivX, MPG, MKV, MPEG, AVI, MOV, OGM, QT, VCD, SVCD, M4V, NSV, NUV, PSP, SMK, VOB, FLV, and WMV. A CD ripping function with CDDB support, batch conversion, tag preservation for most supported formats, independent tag reading/writing, and extensions for Amarok, Dolphin, and Konqueror are also provided. OPTIONS
-t, --to format set encode format for the input file(s) or directory(s). you can see a complete list of supported encode formats by using the --formats option. -r, --recursive recursively scan and convert input folder(s) to desination format. -p, --preserve when recursively converting a directory, preserve the input folders directory structure in the specified output directory. such as: pacpl --to ogg -r -p /home/mp3s --outdir /home/oggs in the example above, let's assume the directory structure was: /home/mp3s/Alternative /home/mp3s/Alternative/New /home/mp3s/Rap /home/mp3s/Country /home/mp3s/Techno/ the output directory will now contain: /home/oggs/Alternative /home/oggs/Alternative/New /home/oggs/Rap /home/oggs/Country /home/oggs/Techno with all files in each sub-folder converted to ogg. -o, --only format only convert files matching extenstion. this option is useful when you have a directory or batch of files with mixed audio types and only need to convert one specific type. -k, --keep do not re-encode files with extensions matching the destination extension. instead...copy them to the output folder, or skip to the next file. -f, --formats show a list of supported encode/decode formats. -h, --help show the short help menu. -l, --longhelp display the complete list of options. --version show version and licensing information. USER OPTIONS
--defopts 1/0 to turn off default encoder options use --defopts 0. this option gives you more control when using the --eopts command. defopts is set to 1 by default. you can also toggle this option in /etc/pacpl/pacpl.conf. --eopts options this option allows you to use encoder options not implemented by pacpl. an example would be: pacpl --to mp4 --eopts="-c 44100 -I 1,2" YourFile.mp3 --dopts options this option allows you to use decoder options not implemented by pacpl. an example would be: pacpl --to mpc --dopts="--start 60" YourFile.ogg --outfile name set the output file name to name. --outdir directory place all encoded files in directory. --dryrun show what would be done without actually converting anything. this is a good way to trouble shoot, or to see what would be done without actually touching your files. --overwrite replace the output file if it already exists. --normalize adjusts volume levels of audio files. --nopts options this allows you to specify normalize options not implemented by pacpl --delete remove source/input file after the conversion process has finished. --encoder encoder specify an alternate encoder for the selected output file(s) you can see a list of supported encoders by using the following: pacpl --encoder format --decoder decoder specify an alternate decoder for the selected input file(s) you can see a list of supported decoders by using the following: pacpl --decoder format -v, --verbose show detailed information about the encoding process and what's actually being done. ENCODER OPTIONS
--bitrate num set the bitrate to num. default is 128. this option does not apply to all formats. --freq num set the frequency to num. default is 44100. this option does not apply to all formats. --channels num set the number of audio channels in the output file to num. this option does not apply to all formats. --effect str see sox(1). this option only applies to the following: AIFF, AU, SND, RAW, VOC, SMP, AVR, and CDR --fcomp num set flac compression level to num. fastest -0, highest -8, default -2 --pcomp num set lpac/pac compression level to num. 1 = fast 2 = simple 3 = medium (default) 4 = high 5 = extra high, --acomp num set ape compression level to num. 1000 = fast 2000 = normal 3000 = high (default) 4000 = extra high 5000 = insane --oggqual num set ogg quality level to num. -1, very low and 10 very high, default 3 --spxqual num set speex quality level to num. 0-10, default 8 --aacqual num set aac, mp4, m4a, or m4b quality level to num. default 300 --mpcqual str set mpc/mpp quality level to str. thumb low quality/internet, (typ. 58... 86 kbps) radio medium (MP3) quality, (typ. 112...152 kbps - default) standard high quality (dflt), (typ. 142...184 kbps) xtreme extreme high quality, (typ. 168...212 kbps) --ofmode str set ofr/ofs compression mode to str. normal, extra, and extranew modes are recommended for general use. available options are: fast normal (default) high extra best highnew extranew bestnew --ofopt str set ofr/ofs optimization level to str. specify the optimization level in the engine. In order to achieve optimal compression at all sample types, sample rates, and audio content, the core compression engine has the possibility to find the optimal values for its parameters, at the cost of slightly increased compression time only. The default recommended value is fast. do not use normal (or even high or best) for this parameter unless encoding time does not matter and you want to obtain the smallest possible file for a given compression mode. The difference between the optimize levels fast and best (which is up to three times slower than fast) is very small, generally under 0.05%, but may be also larger in some rare cases. Note that the none optimize level is forced by the encoder to fast optimize level for the extra, best, highnew, extranew, and bestnew modes. available options are: none fast (default) normal high best --bratio num set bonk down sampling ratio. default 2 --bquanl num set bonk quantanization level. default 1.0 --bpsize num set bonk predictor size. default 128 TAGGING OPTIONS
note: tagging outside of the encoding process can only be performed on the following audio types: MP3 OGG FLA FLAC --artist str set artist information to str. --title str set title information to str. --track num set track information to num. --year num set year/date information to num. --album str set album information to str. --genre str set genre information to str. --comment str set comment information to str. --taginfo file show tagging information for file. multiple files can be specified at once. RIPPING OPTIONS
--rip num/all rip selected tracks separated by comma or all from current disc. pacpl --rip all --to flac pacpl --rip 1,3,9,15 --to flac --nocddb disable cddb. use this option if you do not want tagging based on cddb. --noinput disable cddb interactivity. this is enabled by default. --nscheme str set naming scheme to str. default is %ar - %ti available options are: %ar = artist %ti = song title %tr = track %yr = year %ab = album eg: --nscheme="(%tr)-%ti" --device str set device to str. default is /dev/cdrom --cdinfo show cddb information for current disc. SEE ALSO
sox(1) ffmpeg(1) lame(1) oggenc(1) oggdec(1) flac(1) shorten(1) faac(1) faad(1) mppenc(1) mppdec(1) mplayer(1) speexenc(1) speexdec(1) sndfile-convert(1) normalize(1) cdparanoia(1) BUGS
Report all bugs to Philip Lyons (viiron@gmail.com). LICENSING
This program 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 MERCHANTABILITY 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/>. AUTHOR
Copyright (C) 2005-2009 Philip Lyons (viiron@gmail.com) perl v5.14.2 2012-04-09 PACPL(1)
All times are GMT -4. The time now is 08:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy