Replace a string within a file.. with help of positions
Hi,
Thanks for the reply.. The code worked.. but i have a lil diffrent reqt...
Actually.. The lines will contain different values...
Characters in between 12 -22 in each line... i m giving an example below...
OLD Values:
New Values:
I need to add "1100" just before each of these words within "11 - 22" positions, in each line.... There will be 4 spaces for sure.... but the point is there can be more spaces also.. but i should add "1100" just before the existing word.. and keep the remaining as spaces..
Please help.
Thanks.
Gopi
Last edited by Franklin52; 03-02-2011 at 09:57 AM..
Reason: Please use code tags
Hi
i am having text file like this
40000201040005200213072009000000700000050744820906904421
40069300240005200713072009000000067400098543630000920442
i want to replace 9-16 positions of my txt file...by 1234567...in a single line command
i.e
0400052....should be replaced by... (2 Replies)
I am attempting to replace positions 44-46 with YYY if positions 48-50 = XXX.
awk -F "" '{if (substr($0,48,3)=="XXX") $44="YYY"}1' OFS="" $filename > $tempfile
But this is not working, 44-46 is still spaces in my tempfile instead of YYY. Any suggestions would be greatly appreciated. (9 Replies)
Can someone tell me how I can do this?
e.g:
Say file1.txt contains:
today is monday
the 22 of
NOVEMBER
2010
and file2.txt contains:
the
11th
month
of
How do i replace the word NOVEMBER with (5 Replies)
I need to replace dashes (i.e. -) if present from positions 351-357 with zero (i.e. 0), I also need to replace dash (i.e “-“) if present between position 024-043 with zero (i.e. 0) & I replace " " (i.e. 2 space characters) if present at position 381-382 with "04". Total length of record is 413.... (11 Replies)
Script for if characters from positions 7-15 are matching with characters from position 211-219 then replace all char from 211-219 with 9 space.
Total length of record is 420. Here is the specification of the data in file.
Position Field Data Type... (2 Replies)
Hi, I am trying to use an awk command to replace specific character positions on a line beginning with 80 with contents of another file.
The line beginning with 80 in file1 is as follows:
I want to replace the 000000000178800 (positions 34 - 49) on this file with the contents of... (2 Replies)
Hi all, I have column 2 full of values like HIVE4A-56 and HIVE4-56. I want to convert all values like HIVE4A-56 to HIVE4-56.
So basically I want to delete all single alphabets before the '-' which is always preceded by a number. Values already in the desired format should remain unchanged... (4 Replies)
My objective is to replace the 8th, 9th, 10th characters by 1 space per character (total 3 spaces) in a file.
I achieved this using following command:
sed 's/\(.\)/\1@/7;s/@\(...\)/ /' FileData.txt > FileData_UPDATED.txt
Another situation comes when I need to done same but excluding 1st... (5 Replies)
I have a test file a.txt
001 123 456 789
002 This is just a
001 test data
003 file.
I want to clear columns 5 and 6 if the first 3 characters are 001 using awk.
I tried following but does not work. Any suggestions?
awk 'BEGIN{OFS=FS=""} {if (substr($0,1,3)=="123") $5=" "; $6="... (20 Replies)
I have a fixed-length positional file. I am trying to replace content of position 4-13 (length=10) with xxxxxxxxxx.
Sample 2 rows in this file:
H0187459823 172SMITH, JOE
H0112345678 172DOE, JANE
In this example 87459823 (from 1st line) and 12345678 (from 2nd line) (both in position... (3 Replies)
Discussion started by: Diver181
3 Replies
LEARN ABOUT DEBIAN
locale::currency
Locale::Currency(3perl) Perl Programmers Reference Guide Locale::Currency(3perl)NAME
Locale::Currency - standard codes for currency identification
SYNOPSIS
use Locale::Currency;
$curr = code2currency('usd'); # $curr gets 'US Dollar'
$code = currency2code('Euro'); # $code gets 'eur'
@codes = all_currency_codes();
@names = all_currency_names();
DESCRIPTION
The "Locale::Currency" module provides access to standard codes used for identifying currencies and funds, such as those defined in ISO
4217.
Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 4217
three-letter codes will be used.
SUPPORTED CODE SETS
There are several different code sets you can use for identifying currencies. The ones currently supported are:
alpha
This is a set of three-letter (uppercase) codes from ISO 4217 such as EUR for Euro.
Two of the codes specified by the standard (XTS which is reserved for testing purposes and XXX which is for transactions where no
currency is involved) are omitted.
This code set is identified with the symbol "LOCALE_CURR_ALPHA".
This is the default code set.
num This is the set of three-digit numeric codes from ISO 4217.
This code set is identified with the symbol "LOCALE_CURR_NUMERIC".
ROUTINES
code2currency ( CODE [,CODESET] )
currency2code ( NAME [,CODESET] )
currency_code2code ( CODE ,CODESET ,CODESET2 )
all_currency_codes ( [CODESET] )
all_currency_names ( [CODESET] )
Locale::Currency::rename_currency ( CODE ,NEW_NAME [,CODESET] )
Locale::Currency::add_currency ( CODE ,NAME [,CODESET] )
Locale::Currency::delete_currency ( CODE [,CODESET] )
Locale::Currency::add_currency_alias ( NAME ,NEW_NAME )
Locale::Currency::delete_currency_alias ( NAME )
Locale::Currency::rename_currency_code ( CODE ,NEW_CODE [,CODESET] )
Locale::Currency::add_currency_code_alias ( CODE ,NEW_CODE [,CODESET] )
Locale::Currency::delete_currency_code_alias ( CODE [,CODESET] )
These routines are all documented in the Locale::Codes man page.
SEE ALSO
Locale::Codes
Locale::Constants
http://www.iso.org/iso/support/currency_codes_list-1.htm
The ISO 4217 data.
AUTHOR
See Locale::Codes for full author history.
Currently maintained by Sullivan Beck (sbeck@cpan.org).
COPYRIGHT
Copyright (c) 1997-2001 Canon Research Centre Europe (CRE).
Copyright (c) 2001 Michael Hennecke
Copyright (c) 2001-2010 Neil Bowers
Copyright (c) 2010-2011 Sullivan Beck
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2011-09-26 Locale::Currency(3perl)