Sponsored Content
Top Forums Shell Programming and Scripting Find and replace a string a specific value in specific location in AIX Post 302403161 by anbu23 on Thursday 11th of March 2010 05:04:11 PM
Old 03-11-2010
Code:
sed "s/^\(.\{5\}\)2D3M/\12A3M/" file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find pid of process run in specific location

Hello, I have a process a.out that runs from /a and /b How can I get the pid of the one running from /a ps -C /a/a.out does not work Thanks! (4 Replies)
Discussion started by: JCR
4 Replies

2. Shell Programming and Scripting

using sed to replace a specific string on a specific line number using variables

using sed to replace a specific string on a specific line number using variables this is where i am at grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean grep -n Destination... (2 Replies)
Discussion started by: todd.cutting
2 Replies

3. Shell Programming and Scripting

Finding a word at specific location in a string

Hi All , I have different strings (SQL queries infact) of different lengths such as: 1. "SELECT XYZ FROM ABC WHERE ABC.DEF='123' " 2. "DELETE FROM ABC WHERE ABC.DEF='567'" 3. "SELECT * FROM ABC" I need to find out the word coming after the... (1 Reply)
Discussion started by: swapnil.nawale
1 Replies

4. Shell Programming and Scripting

How to append a string to a specific location in a line

Hi, I have a to modify a line and insert a keyword in the middle to a specific location. My line looks like this FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS (ABC, DEF, GHI) I want to change it as FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"' TRAILING... (4 Replies)
Discussion started by: mwrg
4 Replies

5. Shell Programming and Scripting

Help with replace character based on specific location

Hi, I got long list of reference file (column one is refer to the header in input file; column 2 is info of start position in input file; column 3 is info of end position in input file;) shown as below: read_2 10 15 read_3 5 8 read_1 4 10 . . . Input file (huge file with total... (6 Replies)
Discussion started by: perl_beginner
6 Replies

6. Shell Programming and Scripting

Replace specific field on specific line sed or awk

I'm trying to update a text file via sed/awk, after a lot of searching I still can't find a code snippet that I can get to work. Brief overview: I have user input a line to a variable, I then find a specific value in this line 10th field in this case. After asking for new input and doing some... (14 Replies)
Discussion started by: crownedzero
14 Replies

7. Shell Programming and Scripting

Replace spaces at a specific Location

Hello All, I have a comma separated file which needs to be loaded to the database. But, I need to trim the white spaces for a specific column before its loaded. Below is the sample line from the input file: 690,690,0575,"01011940","01011940", , , , , ,36720,36722,V2020,V2999,... (6 Replies)
Discussion started by: Praveenkulkarni
6 Replies

8. Shell Programming and Scripting

Using sed to replace a word at specific location

I'm try to change a the prohibit to aix for the lines starting with ssh and emagent and rest should be the same. Can anyone please suggest me how to do that using a shell script or sed passwd account required /usr/lib/security/pam_prohibit passwd session required ... (13 Replies)
Discussion started by: pjeedu2247
13 Replies

9. Shell Programming and Scripting

How to find a word and move it a specific location in xml file using perl?

Hi friends, I have one XML file having below structure :- INput XML file :- <?xml version="1.0" encoding="UTF-8"?> <START> <A=value1> <attr name1="a1"> </A> <B=value2> <attr name2="b1"> <attr name3="c1"> </B> </START> output xml file should be === (3 Replies)
Discussion started by: harpal singh
3 Replies

10. Shell Programming and Scripting

Find and Copy file of specific location

Dear All, I need to transfer all files present in one location to another but those files should be of specific extension like. Find and copy all files of extension .xls, .pdf, .txt from location usr/tmp to location /per/Treat (6 Replies)
Discussion started by: yadavricky
6 Replies
Wav::Write(3pm) 					User Contributed Perl Documentation					   Wav::Write(3pm)

NAME
Audio::Wav::Write - Module for writing Microsoft WAV files. SYNOPSIS
use Audio::Wav; my $wav = new Audio::Wav; my $sample_rate = 44100; my $bits_sample = 16; my $details = { 'bits_sample' => $bits_sample, 'sample_rate' => $sample_rate, 'channels' => 1, # if you'd like this module not to use a write cache, uncomment the next line #'no_cache' => 1, }; my $write = $wav -> write( 'testout.wav', $details ); &add_sine( 200, 1 ); sub add_sine { my $hz = shift; my $length = shift; my $pi = ( 22 / 7 ) * 2; $length *= $sample_rate; my $max_no = ( 2 ** $bits_sample ) / 2 - 1; for my $pos ( 0 .. $length ) { $time = $pos / $sample_rate; $time *= $hz; my $val = sin $pi * $time; my $samp = $val * $max_no; $write -> write( $samp ); } } $write -> finish(); DESCRIPTION
Currently only writes to a file. SEE ALSO
Audio::Wav Audio::Wav::Read NOTES
This module shouldn't be used directly, a blessed object can be returned from Audio::Wav. METHODS
finish Finishes off & closes the current wav file. $write -> finish(); add_cue Adds a cue point to the wav file. If $sample is undefined then the position will be the current position (end of all data written so far). # $byte_offset for 01 compatibility mode $write -> add_cue( $sample, "label", "note" ); set_sampler_info All parameters are optional. my %info = ( 'midi_pitch_fraction' => 0, 'smpte_format' => 0, 'smpte_offset' => 0, 'product' => 0, 'sample_period' => 0, 'manufacturer' => 0, 'sample_data' => 0, 'midi_unity_note' => 65, ); $write -> set_sampler_info( %info ); add_sampler_loop All parameters are optional except start & end. my $length = $read -> length_samples(); my( $third, $twothirds ) = map int( $length / $_ ), ( 3, 1.5 ); my %loop = ( 'start' => $third, 'end' => $twothirds, 'fraction' => 0, 'type' => 0, ); $write -> add_sampler_loop( %loop ); add_display set_info Sets information to be contained in the wav file. $write -> set_info( 'artist' => 'Nightmares on Wax', 'name' => 'Mission Venice' ); file_name Returns the current filename. my $file = $write -> file_name(); write Adds a sample to the current file. $write -> write( @sample_channels ); Each element in @sample_channels should be in the range of; where $samp_max = ( 2 ** bits_per_sample ) / 2 -$samp_max to +$samp_max write_raw Adds some pre-packed data to the current file. $write -> write_raw( $data, $data_length ); Where; $data is the packed data $data_length (optional) is the length in bytes of the data write_raw_samples Adds some pre-packed data to the current file, returns number of samples written. $write -> write_raw_samples( $data, $data_length ); Where; $data is the packed data $data_length (optional) is the length in bytes of the data AUTHORS
Nick Peskett (see http://www.peskett.co.uk/ for contact details). Kurt George Gjerde <kurt.gjerde@media.uib.no>. (0.02-0.03) perl v5.14.2 2012-03-30 Wav::Write(3pm)
All times are GMT -4. The time now is 02:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy