Sponsored Content
Top Forums Shell Programming and Scripting Replace second to last but one consecutive occurence Post 302896755 by Scrutinizer on Wednesday 9th of April 2014 06:17:13 AM
Old 04-09-2014
Try:
Code:
sed -e 's/\(  *\) /\1WRU /g' -e :a -e 's/  \([HW]RU\)/ HRU\1/;ta' file

I believe there should be six HRU's (2nd until last -1) not 7, correct?
This User Gave Thanks to Scrutinizer For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace string B depending on occurence of string A

Depending upon the occurence of string 'xyz', I want to remove -t from the input file. There is not a fixed length input file. Any suggestions Input file: this is xyz line -t of the data this is line 2 of -t of the data xyz this is line 3 of -t the file this is line xyz of the -t file... (1 Reply)
Discussion started by: hemangjani
1 Replies

2. Shell Programming and Scripting

Replace matching nth occurence

Hi for eg my file has: val1 | val2 | val1 | val2 | val1 | val2 | val1 | val2 | here i need to replace '|' with '|\n' where the occurence of '|' is divisble by 2 so that the output comes like this val1 | val2 | val1 | val2 | val1 | val2 | val1 | val2 | Requesting suggestions in... (1 Reply)
Discussion started by: raghav288
1 Replies

3. Shell Programming and Scripting

Script to replace last instance of . between two consecutive = sign by ,

Suppose you have a line like this: cn=user.blr.ou=blr.india.o=company The line should be converted like this: cn=user.blr,ou=blr.india,o=comapny Was wondering how to do that using shell script. Please use tags where appropriate, thank you (4 Replies)
Discussion started by: saurabhkoar
4 Replies

4. Shell Programming and Scripting

[Solved] Find and replace till nth occurence of a special character

Hi, I have a requirement to search for a pattern in each line in a file and remove the in between words till the 3rd occurrence of double quote ("). Ex: CREATE TABLE "SCHEMANAME"."AMS_LTV_STATUS" (Note: "SCHEMANAME" may changes for different schemas. Its not a fixed value) I need to... (2 Replies)
Discussion started by: satyaatcgi
2 Replies

5. Shell Programming and Scripting

Print between patterns - first occurence, second occurence etc

I have a file # cat asasas AAAAAA 11 22 33 44 BBBBB NILNILNIL AAAAAA 22 33 44 55 66 77 88 BBBBB NILNILNIL (2 Replies)
Discussion started by: anil510
2 Replies

6. Shell Programming and Scripting

awk - find first occurence and replace it

Hello, I have a requirement to replace the whole string with first occurence of value of a key-value pair. I have to do this inside awk, as the data I need to work is inside an awk loop. value of my variable(say LogText) looks like: LogText= date=04Mar message=hello1 name=caq... (4 Replies)
Discussion started by: cool.aquarian
4 Replies

7. Shell Programming and Scripting

Grep 2 consecutive lines and replace the second line in a file

I have a file lake this cat ex1.txt </DISCOUNTS> <B2B_SPECIFICATION elem="0"> <B2B_SPECIFICATION elem="0"> <DESCR>Netti 2 </DESCR> <NUMBER>D02021507505</NUMBER> </B2B_SPECIFICATION> <B2B_SPECIFICATION elem="1"> <DESCR>Puhepaketti</DESCR>... (2 Replies)
Discussion started by: Dhoni
2 Replies

8. Shell Programming and Scripting

How to filter out consecutive occurence of digits from file?

Hello, I have a text file containing the following for example: This number 123456 is in line number one. Line number two contains -333444 number. The third line has a 111111 in between and also 435. Line number four has :444444 in it. Line five has a in front like a555555. how can i... (5 Replies)
Discussion started by: james2009
5 Replies

9. AIX

Replace consecutive occurrence of string in same line

Hi All, I have a requirement to replace consecutive occurence of same string nedd to be replaced. Below is the input and desired output. Input: --------- 123.5|ABC|.|.|. 234.4|DEF|.|.|.|.|.| Output: --------- 123.5|ABC|||. 234.4|DEF||||| so basically "|.|" need to be replaced with... (9 Replies)
Discussion started by: ureddy
9 Replies

10. UNIX for Beginners Questions & Answers

sed command to replace consecutive double quotes

I need to replace consecutive double quotes in a csv file, the data in the file is enclosed in double quotes but there are some places where the quotes are repeating Example is below Incoming data is : "Pacific Region"|"PNG"|"Jimmy""|""| Need output as: "Pacific... (10 Replies)
Discussion started by: abhilashnair
10 Replies
Date::Manip::Lang::russian(3)				User Contributed Perl Documentation			     Date::Manip::Lang::russian(3)

NAME
Date::Manip::Lang::russian - Russian language support. SYNOPSIS
This module contains a list of words and expressions supporting the language. It is not intended to be used directly (other Date::Manip modules will load it as needed). LANGUAGE EXPRESSIONS
The following is a list of all language words and expressions used to write times and/or dates. All strings are case insensitive. Month names and abbreviations When writing out the name of the month, several different variations may exist including full names and abbreviations. The following month names may be used: XXXXXX XXXXXX XXXXXXX XXXXXXX XXXXX XXXX XXXXXX XXXXXX XXX XXX XXXX XXXX XXXX XXXX XXXXXXX XXXXXX XXXXXXXX XXXXXXXX XXXXXXX XXXXXXX XXXXXX XXXXXX XXXXXXX XXXXXXX The following abbreviations may be used: XXX XXX. XXX XXX XXXX. XXX XXXXX XXXX XXX XXX. XXX XXX XXX XXXX XXXX XXX XXXX XXXX XXX XXX. XXX XXX XXXX. XXX XXX. XXXX XXX XXXX. XXX XXX. Day names and abbreviations When writing out the name of the day, several different variations may exist including full names and abbreviations. The following day names may be used: XXXXXXXXXXX XXXXXXX XXXXX XXXXXXX XXXXXXX XXXXXXX XXXXXXXXXXX The following abbreviations may be used: XXX XX XXX XXX XX XXX XXX XX XXe XXX XX XXX XXX XX XXX XXX XX XXX XXX XX XXXX The following short (1-2 characters) abbreviations may be used: XX XX XX XX XX XX XX Delta field names These are the names (and abbreviations) for the fields in a delta. There are 7 fields: years, months, weeks, days, hours, minutes, seconds. The names and abbreviations for these fields are: X XX XXX XXX XXX XXXX XXX XXXXX XXXXXXX XXXXXX XXXXXX XXXXXX XXXXXX X XXXX XXXX XXX X X. XX XXX XXX XXXXX XXXX XX XXX XXXXXX XXXXX X XXX XXXXXXX XXXXXX Morning/afternoon times This is a list of expressions use to designate morning or afternoon time when a time is entered as a 12-hour time rather than a 24-hour time. For example, in English, the time "17:00" could be specified as "5:00 PM". Morning and afternoon time may be designated by the following sets of words: XX XX X.X. XXXX XXXX XX XXXXXXX XX XX X.X. XXX XXXXXX XXXXX XXXXXXX XX XXXXXXX Each or every There are a list of words that specify every occurence of something. These are used in the following phrases: EACH Monday EVERY Monday EVERY month The following words may be used: XXXXXX Next/Previous/Last occurence There are a list of words that may be used to specify the next, previous, or last occurence of something. These words could be used in the following phrases: NEXT week LAST tuesday PREVIOUS tuesday LAST day of the month The following words may be used: Next occurence: XXXXXXXXX Previous occurence: XXXXXXXXXX Last occurence: XXXXXXXXX Delta words for going forward/backward in time When parsing deltas, there are words that may be used to specify the the delta will refer to a time in the future or to a time in the past (relative to some date). In English, for example, you might say: IN 5 days 5 days AGO The following words may be used to specify deltas that refer to dates in the past or future respectively: XXXXX XX XXXXXX XX XXXXX Business mode This contains two lists of words which can be used to specify a standard (i.e. non-business) delta or a business delta. Previously, it was used to tell whether the delta was approximate or exact, but now this list is not used except to force the delta to be standard. The following words may be used: XXXXX XXXXXXXX The following words may be used to specify a business delta: XXXXXXX Numbers Numbers may be spelled out in a variety of ways. The following sets correspond to the numbers from 1 to 53: 1 XXXXXX XXXXXXX XXXXXX XXXX 2 XXXXXX XXXXXXX XXXXXX XXX 3 XXXXXX XXXXXXXX XXXXXX XXX 4 XXXXXXXXX XXXXXXXXXX XXXXXXXXX XXXXXX 5 XXXXX XXXXXX XXXXX XXXX 6 XXXXXX XXXXXXX XXXXXX XXXXX 7 XXXXXXX XXXXXXXX XXXXXXX XXXX 8 XXXXXXX XXXXXXXX XXXXXXX XXXXXX 9 XXXXXXX XXXXXXXX XXXXXXX XXXXXX 10 XXXXXXX XXXXXXXX XXXXXXX XXXXXX 11 XXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXX 12 XXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXX 13 XXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXX 14 XXXXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXX 15 XXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXX 16 XXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXX 17 XXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXX 18 XXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXX 19 XXXXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXX 20 XXXXXXXXX XXXXXXXXXX XXXXXXXXX XXXXXXXX 21 XXXXXXXX XXXXXX XXXXXXXX XXXXXXX XXXXXXXX XXXXXX XXXXXXXX XXXX 22 XXXXXXXX XXXXXX XXXXXXXX XXXXXX XXXXXXXX XXXXXX XXXXXXXX XXX 23 XXXXXXXX XXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXX XXXXXXXX XXX 24 XXXXXXXX XXXXXXXXX XXXXXXXX XXXXXXXXXX XXXXXXXX XXXXXXXXX XXXXXXXX XXXXXX 25 XXXXXXXX XXXXX XXXXXXXX XXXXXX XXXXXXXX XXXXX XXXXXXXX XXXX 26 XXXXXXXX XXXXXX XXXXXXXX XXXXXXX XXXXXXXX XXXXXX XXXXXXXX XXXXX 27 XXXXXXXX XXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXX XXXXXXXX XXXX 28 XXXXXXXX XXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXX XXXXXXXX XXXXXX 29 XXXXXXXX XXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXX XXXXXXXX XXXXXX 30 XXXXXXXXX XXXXXXXXXX XXXXXXXXX XXXXXXXX 31 XXXXXXXX XXXXXX XXXXXXXX XXXXXXX XXXXXXXX XXXXXX XXXXXXXX XXXX 32 XXXXXXXX XXXXXX XXXXXXXX XXXXXX XXXXXXXX XXXXXX XXXXXXXX XXX 33 XXXXXXXX XXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXX XXXXXXXX XXX 34 XXXXXXXX XXXXXXXXX XXXXXXXX XXXXXXXXXX XXXXXXXX XXXXXXXXX XXXXXXXX XXXXXX 35 XXXXXXXX XXXXX XXXXXXXX XXXXXX XXXXXXXX XXXXX XXXXXXXX XXXX 36 XXXXXXXX XXXXXX XXXXXXXX XXXXXXX XXXXXXXX XXXXXX XXXXXXXX XXXXX 37 XXXXXXXX XXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXX XXXXXXXX XXXX 38 XXXXXXXX XXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXX XXXXXXXX XXXXXX 39 XXXXXXXX XXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXX XXXXXXXX XXXXXX 40 XXXXXXXXX XXXXX 41 XXXXX XXXXXX XXXXX XXXXXXX XXXXX XXXXXX XXXXX XXXX 42 XXXXX XXXXXX XXXXX XXXXXX XXXXX XXXXXX XXXXX XXX 43 XXXXX XXXXXX XXXXX XXXXXXXX XXXXX XXXXXX XXXXX XXX 44 XXXXX XXXXXXXXX XXXXX XXXXXXXXXX XXXXX XXXXXXXXX XXXXX XXXXXX 45 XXXXX XXXXX XXXXX XXXXXX XXXXX XXXXX XXXXX XXXX 46 XXXXX XXXXXX XXXXX XXXXXXX XXXXX XXXXXX XXXXX XXXXX 47 XXXXX XXXXXXX XXXXX XXXXXXXX XXXXX XXXXXXX XXXXX XXXX 48 XXXXX XXXXXXX XXXXX XXXXXXXX XXXXX XXXXXXX XXXXX XXXXXX 49 XXXXX XXXXXXX XXXXX XXXXXXXX XXXXX XXXXXXX XXXXX XXXXXX 50 XXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXX 51 XXXXXXXXX XXXXXX XXXXXXXXX XXXXXXX XXXXXXXXX XXXXXX XXXXXXXXX XXXX 52 XXXXXXXXX XXXXXX XXXXXXXXX XXXXXX XXXXXXXXX XXXXXX XXXXXXXXX XXX 53 XXXXXXXXX XXXXXX XXXXXXXXX XXXXXXXX XXXXXXXXX XXXXXX XXXXXXXXX XXX Ignored words In writing out dates in common forms, there are a number of words that are typically not important. There is frequently a word that appears in a phrase to designate that a time is going to be specified next. In English, you would use the word AT in the example: December 3 at 12:00 The following words may be used: X Another word is used to designate one member of a set. In English, you would use the words IN or OF: 1st day OF December 1st day IN December The following words may be used: Not defined in this language Another word is use to specify that something is on a certain date. In English, you would use ON: ON July 5th The following words may be used: X Words that set the date, time, or both There are some words that can be used to specify a date, a time, or both relative to now. Words that set the date are similar to the English words 'yesterday' or 'tomorrow'. These are specified as a delta which is added to the current time to get a date. The time is NOT set however, so the delta is only partially used (it should only include year, month, week, and day fields). The following words may be used: XXXXX -0:0:0:1:0:0:0 XXXXXX +0:0:0:1:0:0:0 XXXXXXXXX -0:0:0:2:0:0:0 XXXXXXXXXXX +0:0:0:2:0:0:0 XXXXXXX 0:0:0:0:0:0:0 Words that set only the time of day are similar to the English words 'noon' or 'midnight'. The following words may be used: XXXXXXX 12:00:00 XXXXXXX 00:00:00 Words that set the entire time and date (relative to the current time and date) are also available. In English, the word 'now' is one of these. The following words may be used: XXXXXX 0:0:0:0:0:0:0 Hour/Minute/Second separators When specifying the time of day, the most common separator is a colon (:) which can be used for both separators. Some languages use different pairs. For example, French allows you to specify the time as 13h30:20, so it would use the following pairs: : : [h] [:] The first column is the hour-minute separator and the second column is the minute-second separator. Both are perl regular expressions. A pair of colons is ALWAY allowed for all languages. If a language allows additional pairs, they are listed here: [X] [X] KNOWN BUGS
None known. BUGS AND QUESTIONS
Please refer to the Date::Manip::Problems documentation for information on submitting bug reports or questions to the author. SEE ALSO
Date::Manip - main module documentation LICENSE
This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR
Sullivan Beck (sbeck@cpan.org) perl v5.16.3 2014-06-09 Date::Manip::Lang::russian(3)
All times are GMT -4. The time now is 03:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy