Sponsored Content
Top Forums Shell Programming and Scripting Replace variable length numeric string Post 302284884 by vgersh99 on Friday 6th of February 2009 12:15:38 PM
Old 02-06-2009
Quote:
Originally Posted by djp
sed -e "s/args.*acctnum.*/args=XXXXXXXXX&acctnum=XXXXXXXXX/g" file > file.out

or

perl -i -pe "s/args.*acctnum.*/args=XXXXXXXXX&acctnum=XXXXXXXXX/g" file
Code:
$ echo 'args=123456789&acctnum=123456789'|sed -e "s/args.*acctnum.*/args=XXXXXXXXX&acctnum=XXXXXXXXX/g"
args=XXXXXXXXXargs=123456789&acctnum=123456789acctnum=XXXXXXXXX

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding out the length of a string held within a variable

:confused: Does anyone know which command I can use to find out the length of a string held within a variable? (5 Replies)
Discussion started by: dbrundrett
5 Replies

2. Shell Programming and Scripting

numeric string and length

given a string passed to a program that supposed to be numeric and of a certain length say 8 digits - so say for e.g. need to verify this 01234567 How would I parse this string to validat it meet requirements I tried to use * | sed /\(\{8})/ Thanks in advance (1 Reply)
Discussion started by: dragrid
1 Replies

3. Shell Programming and Scripting

awk - replace number of string length from search and replace for a serialized array

Hello, I really would appreciate some help with a bash script for some string manipulation on an SQL dump: I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump. This is quite easy with sed: sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies

4. Shell Programming and Scripting

Replacing one Char in a string of variable length

Hi all, I am trying to find the best way of making a change to 1 char in a string, the string can be between 1 and 14 characters. I am reading a line in from a file which contains 012341231231:2:102939283:NNN: Require :NBN: 012838238232:3:372932:NNN: Require :NNB: I need to change 1 N or a... (8 Replies)
Discussion started by: nkwilliams
8 Replies

5. UNIX for Dummies Questions & Answers

Find and Replace random numeric value with non-numeric value

Can someone tell me how to change the first column in a very large 17k line file from a random 10 digit numeric value to a non numeric value. The format of lines in the file is: 1702938475,SNU022,201004 the first 10 numbers always begin with 170 (6 Replies)
Discussion started by: Bahf1s
6 Replies

6. Shell Programming and Scripting

String variable to numeric conversion in perl

Hi guys I am having this strange issue.Well my requirement is like below Compare two values between flat file and oracle DB Via perl script I am easily getting the rowcount Now I connect sql plus via perl and the column value that returns is string my $sqlplus_settings = ''; my... (7 Replies)
Discussion started by: Pratik4891
7 Replies

7. Shell Programming and Scripting

Match and variable length string

Hello all, source file looks like this: cat toto.txt NAME) VAR1=tata OPT4=toto USER=blabla TZ=/usr/share/zoneinfo/Hongkong OTHEROPT=something ;; NAME2) VAR1=tata OPT4=toto USER=blabla TZ=/usr/share/zoneinfo/Hongkong SOMETHING=else ... (5 Replies)
Discussion started by: maverick72
5 Replies

8. Shell Programming and Scripting

Extracting substrings from a string of variable length

I have a string like Months=jan feb mar april x y .. Here the number of fields in Months is not definite I need to extract each field in the Months string and pass it to awk . Don't want to use for in since it is a loop . How can i do it (2 Replies)
Discussion started by: Nevergivup
2 Replies

9. Shell Programming and Scripting

Need to replace 32 length string to *****

Hello, I've a file file_1.txt ul.ln = 'Kb' AND (il.sum = 'ec7ccc92585adac28d9b1fb5eff0473f' or length('ec7ccc92585adac28d9b1fb5eff0473f') = 7); il.sum = '20ddc1368d588dd0b0e37c41721e05b1' OR length('20ddc1368d588dd0b0e37c41721e05b1') = 7); I need to replace the file like below - ul.ln... (4 Replies)
Discussion started by: Mannu2525
4 Replies

10. UNIX for Beginners Questions & Answers

Views How to replace a CRLF char from a variable length file in the middle of a string in UNIX?

My sample file is variable length, with out any field delimiters. It has min of 18 chars length and the 'CRLF' is potentially between 12-14 chars. How do I replace this with a space? I still want to keep end of record, but just want to remove these new lines chars in the middle of the data. ... (7 Replies)
Discussion started by: chandrath
7 Replies
DateTime::Locale::gu(3) 				User Contributed Perl Documentation				   DateTime::Locale::gu(3)

NAME
DateTime::Locale::gu SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'gu' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Gujarati. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) XXXXXX XXXXXXX XXXXXX XXXXXXX XXXXXXXX XXXXXX XXXXXX Abbreviated (format) XXX XXXX XXX XXXX XXXXX XXX XXX Narrow (format) XX XX XX XX XX X X Wide (stand-alone) XXXXXX XXXXXXX XXXXXX XXXXXXX XXXXXXXX XXXXXX XXXXXX Abbreviated (stand-alone) XXX XXXX XXX XXXX XXXXX XXX XXX Narrow (stand-alone) XX XX XX XX XX X X Months Wide (format) XXXXXXXXX XXXXXXXXX XXXXX XXXXXX XX XXX XXXXX XXXXX XXXXXXXXX XXXXXXX XXXXXXX XXXXXXXX Abbreviated (format) XXXXXX XXXXXX XXXXX XXXXXX XX XXX XXXXX XXXXX XXXXX XXXXX XXX XXXX Narrow (format) XX XX XX X XX XX XX X X X X XX Wide (stand-alone) XXXXXXXXX XXXXXXXXX XXXXX XXXXXX XX XXX XXXXX XXXXX XXXXXXXXX XXXXXXX XXXXXXX XXXXXXXX Abbreviated (stand-alone) XXXXXX XXXXXX XXXXX XXXXXX XX XXX XXXXX XXXXX XXXXX XXXXX XXX XXXX Narrow (stand-alone) XX XX XX X XX XX XX X X X X XX Quarters Wide (format) XXXX XXXXXXXXX XXXX XXXXXXXXX XXXXXX XXXXXXXXX XXXX XXXXXXXXX Abbreviated (format) XXXXXXXXX X XXXXXXXXX X XXXXXXXXX X XXXXXXXXX X Narrow (format) 1 2 3 4 Wide (stand-alone) XXXX XXXXXXXXX XXXX XXXXXXXXX XXXXXX XXXXXXXXX XXXX XXXXXXXXX Abbreviated (stand-alone) XXXXXXXXX X XXXXXXXXX X XXXXXXXXX X XXXXXXXXX X Narrow (stand-alone) 1 2 3 4 Eras Wide XXXXXX XXXXXX XXXXXX Abbreviated BCE CE Narrow X X XX XX Date Formats Full 2008-02-05T18:30:30 = XXXXXXX, 5 XXXXXXXXX, 2008 1995-12-22T09:05:02 = XXXXXXXX, 22 XXXXXXXX, 1995 -0010-09-15T04:44:23 = XXXXXX, 15 XXXXXXXXX, -10 Long 2008-02-05T18:30:30 = 5 XXXXXXXXX, 2008 1995-12-22T09:05:02 = 22 XXXXXXXX, 1995 -0010-09-15T04:44:23 = 15 XXXXXXXXX, -10 Medium 2008-02-05T18:30:30 = 5 XXXXXX, 2008 1995-12-22T09:05:02 = 22 XXXX, 1995 -0010-09-15T04:44:23 = 15 XXXXX, -10 Short 2008-02-05T18:30:30 = 5-02-08 1995-12-22T09:05:02 = 22-12-95 -0010-09-15T04:44:23 = 15-09--10 Default 2008-02-05T18:30:30 = 5 XXXXXX, 2008 1995-12-22T09:05:02 = 22 XXXX, 1995 -0010-09-15T04:44:23 = 15 XXXXX, -10 Time Formats Full 2008-02-05T18:30:30 = 06:30:30 pm UTC 1995-12-22T09:05:02 = 09:05:02 am UTC -0010-09-15T04:44:23 = 04:44:23 am UTC Long 2008-02-05T18:30:30 = 06:30:30 pm UTC 1995-12-22T09:05:02 = 09:05:02 am UTC -0010-09-15T04:44:23 = 04:44:23 am UTC Medium 2008-02-05T18:30:30 = 06:30:30 pm 1995-12-22T09:05:02 = 09:05:02 am -0010-09-15T04:44:23 = 04:44:23 am Short 2008-02-05T18:30:30 = 06:30 pm 1995-12-22T09:05:02 = 09:05 am -0010-09-15T04:44:23 = 04:44 am Default 2008-02-05T18:30:30 = 06:30:30 pm 1995-12-22T09:05:02 = 09:05:02 am -0010-09-15T04:44:23 = 04:44:23 am Datetime Formats Full 2008-02-05T18:30:30 = XXXXXXX, 5 XXXXXXXXX, 2008 06:30:30 pm UTC 1995-12-22T09:05:02 = XXXXXXXX, 22 XXXXXXXX, 1995 09:05:02 am UTC -0010-09-15T04:44:23 = XXXXXX, 15 XXXXXXXXX, -10 04:44:23 am UTC Long 2008-02-05T18:30:30 = 5 XXXXXXXXX, 2008 06:30:30 pm UTC 1995-12-22T09:05:02 = 22 XXXXXXXX, 1995 09:05:02 am UTC -0010-09-15T04:44:23 = 15 XXXXXXXXX, -10 04:44:23 am UTC Medium 2008-02-05T18:30:30 = 5 XXXXXX, 2008 06:30:30 pm 1995-12-22T09:05:02 = 22 XXXX, 1995 09:05:02 am -0010-09-15T04:44:23 = 15 XXXXX, -10 04:44:23 am Short 2008-02-05T18:30:30 = 5-02-08 06:30 pm 1995-12-22T09:05:02 = 22-12-95 09:05 am -0010-09-15T04:44:23 = 15-09--10 04:44 am Default 2008-02-05T18:30:30 = 5 XXXXXX, 2008 06:30:30 pm 1995-12-22T09:05:02 = 22 XXXX, 1995 09:05:02 am -0010-09-15T04:44:23 = 15 XXXXX, -10 04:44:23 am Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 XXXX 1995-12-22T09:05:02 = 22 XXXXX -0010-09-15T04:44:23 = 15 XXX Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 pm 1995-12-22T09:05:02 = 9:05 am -0010-09-15T04:44:23 = 4:44 am Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 pm 1995-12-22T09:05:02 = 9:05:02 am -0010-09-15T04:44:23 = 4:44:23 am M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = XXXX, 2-5 1995-12-22T09:05:02 = XXXXX, 12-22 -0010-09-15T04:44:23 = XXX, 9-15 MMdd (dd-MM) 2008-02-05T18:30:30 = 05-02 1995-12-22T09:05:02 = 22-12 -0010-09-15T04:44:23 = 15-09 MMM (LLL) 2008-02-05T18:30:30 = XXXXXX 1995-12-22T09:05:02 = XXXX -0010-09-15T04:44:23 = XXXXX MMMd (MMM d) 2008-02-05T18:30:30 = XXXXXX 5 1995-12-22T09:05:02 = XXXX 22 -0010-09-15T04:44:23 = XXXXX 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = XXXX XXXXXX 5 1995-12-22T09:05:02 = XXXXX XXXX 22 -0010-09-15T04:44:23 = XXX XXXXX 15 MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 XXXXXXXXX 1995-12-22T09:05:02 = 22 XXXXXXXX -0010-09-15T04:44:23 = 15 XXXXXXXXX MMMMEd (E MMMM d) 2008-02-05T18:30:30 = XXXX XXXXXXXXX 5 1995-12-22T09:05:02 = XXXXX XXXXXXXX 22 -0010-09-15T04:44:23 = XXX XXXXXXXXX 15 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = XXXX, 2008-2-5 1995-12-22T09:05:02 = XXXXX, 1995-12-22 -0010-09-15T04:44:23 = XXX, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 XXXXXX 1995-12-22T09:05:02 = 1995 XXXX -0010-09-15T04:44:23 = -10 XXXXX yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = XXXX, 2008 XXXXXX 5 1995-12-22T09:05:02 = XXXXX, 1995 XXXX 22 -0010-09-15T04:44:23 = XXX, -10 XXXXX 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 XXXXXXXXX 1995-12-22T09:05:02 = 1995 XXXXXXXX -0010-09-15T04:44:23 = -10 XXXXXXXXX yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 XXXXXXXXX X 1995-12-22T09:05:02 = 1995 XXXXXXXXX X -0010-09-15T04:44:23 = -10 XXXXXXXXX X yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyyyMM (MM-yyyy) 2008-02-05T18:30:30 = 02-2008 1995-12-22T09:05:02 = 12-1995 -0010-09-15T04:44:23 = 09--010 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = XXXXXXXXX 2008 1995-12-22T09:05:02 = XXXXXXXX 1995 -0010-09-15T04:44:23 = XXXXXXXXX -10 Miscellaneous Prefers 24 hour time? No Local first day of the week XXXXXX SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.16.2 2013-08-25 DateTime::Locale::gu(3)
All times are GMT -4. The time now is 03:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy