Sponsored Content
Top Forums Shell Programming and Scripting Search comppare replace (substr/lppad) Post 302973122 by Showdown on Saturday 14th of May 2016 03:05:23 PM
Old 05-14-2016
Oracle

Hi Rudic,

Much thanks for your help. It pretty much serve my purpose.
To be true, I couldn't understand the syntax which I am trying now to understand.

The only discrepancy here is after formatting using the code mentioned by you the next column is getting shifted by 4 spaces. Please see below.

Code:
XXXXXXX XXXXX                 MM11111    ZM    0         000000000000000000000OREGON XXXXXXX HXN  001111  01010  -->Original
XXXXXXX YYYYY                 MM11111    ZM 0000     000000000000000000000OREGON XXXXXXX HXN  001111  01010      -->After format


If you can help me with the code modification so that the total record length remains the same and next column value doesn't get shifted by 4 spaces it will be really great of you.

Thanks again.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: Search for string on line then search and replace text

Hi All, I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text. An example of 4 lines in my file is: 1. MatchText_randomNumberOfText moreData ReplaceMe moreData 2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Discussion started by: Crypto
4 Replies

2. Shell Programming and Scripting

Search and replace

Hi All, Suppose I have a file "a.doc" It's contents are : mos44.0 ) ..... ...... ..... export TKTS_RELEASE=tkts44.0b7 ...... ....... Now , I need to first search for the pattern "mos44.0 )" and then TKTS_RELEASE will... (8 Replies)
Discussion started by: sanyerra
8 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

perl search and replace - search in first line and replance in 2nd line

Dear All, i want to search particular string and want to replance next line value. following is the test file. search string is tmp,??? ,10:1 "???" may contain any 3 character it should remain the same and next line replace with ,10:50 tmp,123 --- if match tmp,??? then... (3 Replies)
Discussion started by: arvindng
3 Replies

5. Shell Programming and Scripting

AWK Substr - find and replace question...

Hello Experts, I have a input file that I need to replace a value only if the file contains the number 6 in column 1. I would like to use AWK in a shell script (ksh on a AIX platform). I need all rows written out, but only change 2 fields when the first column contains a numer 6. Input... (2 Replies)
Discussion started by: scottb
2 Replies

6. UNIX for Dummies Questions & Answers

Help with search and replace or search only of / in vi

Hi all, I am editing a config file in vi that has a / on it. At the moment, search and replace looks alright as am able to use a # as a temporary separator, i.e. :,$s#/u01/app#/u02/app#g For doing a search, I have to escape the / do. So if I want to search for /u01/app, I am having to do... (2 Replies)
Discussion started by: newbie_01
2 Replies

7. Shell Programming and Scripting

search and replace.

Hi, I have a file which contains data in this form. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */;... (2 Replies)
Discussion started by: arijitsaha
2 Replies

8. Shell Programming and Scripting

Search for a substr with nawk

Hi, I have files, with fixed length fields/let's say every field 5 positions/, like this: xxxx 140 xxxxx xxxx 140 xxxxx xxxx 1400 xxxxx xxxx 150 xxxxx I need to get only the records, which have 140 in the second column. I use that command: nawk '{if (substr($0,6,3)=="140") print $0}'... (3 Replies)
Discussion started by: apenkov
3 Replies

9. Shell Programming and Scripting

Nested search in a file and replace the inner search

Hi Team, I am new to unix, please help me in this. I have a file named properties. The content of the file is : ##Mobile props east.url=https://qa.east.corp.com/prop/end west.url=https://qa.west.corp.com/prop/end south.url=https://qa.south.corp.com/prop/end... (2 Replies)
Discussion started by: tolearn
2 Replies

10. Shell Programming and Scripting

awk to comppare two files using rwo fields

I use the two awk scripts for comparing file1 and file2. First awk compare $3 column: awk -v OFS="\t" 'NR==FNR{a=$4;next}{$2=$2 "\t"(a?a:"-")}1' file1 file2Second awk compare $2 column: awk -v OFS="\t" 'NR==FNR{a=$4;next}{$2=$2 "\t"(a?a:"-")}1' file1 file2 The only difference ... (12 Replies)
Discussion started by: cmccabe
12 Replies
DateTime::Locale::hi_IN(3)				User Contributed Perl Documentation				DateTime::Locale::hi_IN(3)

NAME
DateTime::Locale::hi_IN SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'hi_IN' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Hindi India. DATA
This locale inherits from the DateTime::Locale::hi 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) XXXXX XXXXX XXXXX XXXXXX XX XXX XXXXX XXXXX XXXXXXX XXXXXXX XXXXXX XXXXXXX Abbreviated (format) XXXXX XXXXX XXXXX XXXXXX XX XXX XXXXX XXXXX XXXXXXX XXXXXXX XXXXXX XXXXXXX Narrow (format) X XX XX X X XX XX X XX X X XX Wide (stand-alone) XXXXX XXXXX XXXXX XXXXXX XX XXX XXXXX XXXXX XXXXXXX XXXXXXX XXXXXX XXXXXXX Abbreviated (stand-alone) XXXXX XXXXX XXXXX XXXXXX XX XXX XXXXX XXXXX XXXXXXX XXXXXXX XXXXXX XXXXXXX Narrow (stand-alone) X XX XX X X XX XX X XX X X XX Quarters Wide (format) XXXXX XXXXX XXXXXXX XXXXX XXXXX XXXXX XXXXXX XXXXX Abbreviated (format) XXXXX XXXXX XXXXXXX XXXXX XXXXX XXXXX XXXXXX XXXXX Narrow (format) 1 2 3 4 Wide (stand-alone) XXXXX XXXXX XXXXXXX XXXXX XXXXX XXXXX XXXXXX XXXXX Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide BCE CE Abbreviated XXXXXXXX XX Narrow XXXXXXXX XX Date Formats Full 2008-02-05T18:30:30 = XXXXXXX, 5 XXXXX 2008 1995-12-22T09:05:02 = XXXXXXXX, 22 XXXXXXX 1995 -0010-09-15T04:44:23 = XXXXXX, 15 XXXXXXX -10 Long 2008-02-05T18:30:30 = 5 XXXXX 2008 1995-12-22T09:05:02 = 22 XXXXXXX 1995 -0010-09-15T04:44:23 = 15 XXXXXXX -10 Medium 2008-02-05T18:30:30 = 05-02-2008 1995-12-22T09:05:02 = 22-12-1995 -0010-09-15T04:44:23 = 15-09--010 Short 2008-02-05T18:30:30 = 5-2-08 1995-12-22T09:05:02 = 22-12-95 -0010-09-15T04:44:23 = 15-9--10 Default 2008-02-05T18:30:30 = 05-02-2008 1995-12-22T09:05:02 = 22-12-1995 -0010-09-15T04:44:23 = 15-09--010 Time Formats Full 2008-02-05T18:30:30 = 6:30:30 PM UTC 1995-12-22T09:05:02 = 9:05:02 AM UTC -0010-09-15T04:44:23 = 4:44:23 AM UTC Long 2008-02-05T18:30:30 = 6:30:30 PM UTC 1995-12-22T09:05:02 = 9:05:02 AM UTC -0010-09-15T04:44:23 = 4:44:23 AM UTC Medium 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 Short 2008-02-05T18:30:30 = 6:30 PM 1995-12-22T09:05:02 = 9:05 AM -0010-09-15T04:44:23 = 4:44 AM Default 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 Datetime Formats Full 2008-02-05T18:30:30 = XXXXXXX, 5 XXXXX 2008 6:30:30 PM UTC 1995-12-22T09:05:02 = XXXXXXXX, 22 XXXXXXX 1995 9:05:02 AM UTC -0010-09-15T04:44:23 = XXXXXX, 15 XXXXXXX -10 4:44:23 AM UTC Long 2008-02-05T18:30:30 = 5 XXXXX 2008 6:30:30 PM UTC 1995-12-22T09:05:02 = 22 XXXXXXX 1995 9:05:02 AM UTC -0010-09-15T04:44:23 = 15 XXXXXXX -10 4:44:23 AM UTC Medium 2008-02-05T18:30:30 = 05-02-2008 6:30:30 PM 1995-12-22T09:05:02 = 22-12-1995 9:05:02 AM -0010-09-15T04:44:23 = 15-09--010 4:44:23 AM Short 2008-02-05T18:30:30 = 5-2-08 6:30 PM 1995-12-22T09:05:02 = 22-12-95 9:05 AM -0010-09-15T04:44:23 = 15-9--10 4:44 AM Default 2008-02-05T18:30:30 = 05-02-2008 6:30:30 PM 1995-12-22T09:05:02 = 22-12-1995 9:05:02 AM -0010-09-15T04:44:23 = 15-09--010 4: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 GGGGyMMMMEEEEdd (EEEE,dd MMMM GGGGy) 2008-02-05T18:30:30 = XXXXXXX,05 XXXXX CE2008 1995-12-22T09:05:02 = XXXXXXXX,22 XXXXXXX CE1995 -0010-09-15T04:44:23 = XXXXXX,15 XXXXXXX BCE-10 HHmm (HH:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 hhmm (hh:mm a) 2008-02-05T18:30:30 = 06:30 PM 1995-12-22T09:05:02 = 09:05 AM -0010-09-15T04:44:23 = 04:44 AM HHmmss (HH:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 hhmmss (hh:mm:ss a) 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 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 (d/M) 2008-02-05T18:30:30 = 5/2 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/9 MEd (E, d/M) 2008-02-05T18:30:30 = XXXX, 5/2 1995-12-22T09:05:02 = XXXXX, 22/12 -0010-09-15T04:44:23 = XXX, 15/9 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 = XXXXX 1995-12-22T09:05:02 = XXXXXXX -0010-09-15T04:44:23 = XXXXXXX MMMd (d MMM) 2008-02-05T18:30:30 = 5 XXXXX 1995-12-22T09:05:02 = 22 XXXXXXX -0010-09-15T04:44:23 = 15 XXXXXXX MMMdd (dd MMM) 2008-02-05T18:30:30 = 05 XXXXX 1995-12-22T09:05:02 = 22 XXXXXXX -0010-09-15T04:44:23 = 15 XXXXXXX MMMEd (E, d MMM) 2008-02-05T18:30:30 = XXXX, 5 XXXXX 1995-12-22T09:05:02 = XXXXX, 22 XXXXXXX -0010-09-15T04:44:23 = XXX, 15 XXXXXXX MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 XXXXX 1995-12-22T09:05:02 = 22 XXXXXXX -0010-09-15T04:44:23 = 15 XXXXXXX MMMMEd (E, d MMMM) 2008-02-05T18:30:30 = XXXX, 5 XXXXX 1995-12-22T09:05:02 = XXXXX, 22 XXXXXXX -0010-09-15T04:44:23 = XXX, 15 XXXXXXX 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 (M-y) 2008-02-05T18:30:30 = 2-2008 1995-12-22T09:05:02 = 12-1995 -0010-09-15T04:44:23 = 9--10 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 (MMM y) 2008-02-05T18:30:30 = XXXXX 2008 1995-12-22T09:05:02 = XXXXXXX 1995 -0010-09-15T04:44:23 = XXXXXXX -10 yMMMEd (EEE, d MMM y) 2008-02-05T18:30:30 = XXXX, 5 XXXXX 2008 1995-12-22T09:05:02 = XXXXX, 22 XXXXXXX 1995 -0010-09-15T04:44:23 = XXX, 15 XXXXXXX -10 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 XXXXX 1995-12-22T09:05:02 = 1995 XXXXXXX -0010-09-15T04:44:23 = -10 XXXXXXX 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 XXXXX XXXXX 1995-12-22T09:05:02 = 1995 XXXXXX XXXXX -0010-09-15T04:44:23 = -10 XXXXX XXXXX yyMMdd (dd-MM-yy) 2008-02-05T18:30:30 = 05-02-08 1995-12-22T09:05:02 = 22-12-95 -0010-09-15T04:44:23 = 15-09--10 yyMMMd (d MMM, yy) 2008-02-05T18:30:30 = 5 XXXXX, 08 1995-12-22T09:05:02 = 22 XXXXXXX, 95 -0010-09-15T04:44:23 = 15 XXXXXXX, -10 yyMMMEEEd (EEE, d MMM yy) 2008-02-05T18:30:30 = XXXX, 5 XXXXX 08 1995-12-22T09:05:02 = XXXXX, 22 XXXXXXX 95 -0010-09-15T04:44:23 = XXX, 15 XXXXXXX -10 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 = XXXXX 2008 1995-12-22T09:05:02 = XXXXXXX 1995 -0010-09-15T04:44:23 = XXXXXXX -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.3 2014-06-10 DateTime::Locale::hi_IN(3)
All times are GMT -4. The time now is 05:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy