Sponsored Content
Top Forums Shell Programming and Scripting Replace words with the first characters Post 302458988 by tukuyomi on Sunday 3rd of October 2010 04:56:46 AM
Old 10-03-2010
Thanks for your suggestions.
But the month can actually be anywhere in the phrase.
I'm searching around awk's gsub command for now but can't yet find something useful.
Code:
echo '3 october 2010' | awk 'gsub(/january|february|march|april|june|july|august|september|october|november|december/,[missing part^^]

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Display text between two words/characters

Using sed or awk, I need to display text between two words/characters. Below are two example inputs and the desired output. In a nutshell, I need the date-range value between the quotes (but only the first occurance of date-range as there can be more than one). Example One Input: xml-report... (1 Reply)
Discussion started by: cmichaelson
1 Replies

2. Shell Programming and Scripting

Script for pulling words of 4 to 7 characters from a file

Even just advice on where to start would be helpful. Thank You (2 Replies)
Discussion started by: Azeus
2 Replies

3. Shell Programming and Scripting

deleting symbols and characters between two words

Hi Please tell me how could i delete symbols, whitespaces, characters, words everything between two words in a line. Let my file is aaa BB ccc ddd eee FF kkk xxx 123456 BB 44^& iop FF 999 xxx uuu rrr BB hhh nnn FF 000 I want to delete everything comes in between BB and FF( deletion... (3 Replies)
Discussion started by: rish_max
3 Replies

4. Programming

Counting characters, words, spaces, punctuations, etc.

I am very new to C programming. How could I write a C program that could count the characters, words, spaces, and punctuations in a text file? Any help will be really appreciated. I am doing this as part of my C learning exercise. Thanks, Ajay (4 Replies)
Discussion started by: ajay41aj
4 Replies

5. Shell Programming and Scripting

Shell script to find out words, replace them and count words

hello, i 'd like your help about a bash script which: 1. finds inside the html file (it is attached with my post) the code number of the Latest Stable Kernel, 2.finds the link which leads to the download location of the Latest Stable Kernel version, (the right link should lead to the file... (3 Replies)
Discussion started by: alex83
3 Replies

6. Shell Programming and Scripting

Get characters between two words

Guys, Here is the txt file... SLIC N0SLU704034789 rŒ° EJ00 ó<NL DMRG>11 100 4B 2 SLIC N0SLU704034789 rŒ° TJ10 <4000><NL> 2 SLIC N0SLU704034789 ... (2 Replies)
Discussion started by: gowrishankar05
2 Replies

7. Shell Programming and Scripting

Replace special characters with Escape characters?

i need to replace the any special characters with escape characters like below. test!=123-> test\!\=123 !@#$%^&*()-= to be replaced by \!\@\#\$\%\^\&\*\(\)\-\= (8 Replies)
Discussion started by: laknar
8 Replies

8. Shell Programming and Scripting

Perl: Pattern to remove words with less than 2 characters.

Hello. I've been thinking about how to go about this. I know I'm close but still does not work. I need to remove any word in that is not at least 2 characters long. I've removed all the non-alphabetic characters already (numbers included). Here's an example: my $string = "This string is a... (4 Replies)
Discussion started by: D2K
4 Replies

9. UNIX for Dummies Questions & Answers

Replace the words in the file to the words that user type?

Hello, I would like to change my setting in a file to the setting that user input. For example, by default it is ONBOOT=ON When user key in "YES", it would be ONBOOT=YES -------------- This code only adds in the entire user input, but didn't replace it. How do i go about... (5 Replies)
Discussion started by: malfolozy
5 Replies

10. Shell Programming and Scripting

Replace particular words in file based on if finds another words in that line

Hi All, I need one help to replace particular words in file based on if finds another words in that file . i.e. my self is peter@king. i am staying at north sydney. we all are peter@king. How to replace peter to sham if it finds @king in any line of that file. Please help me... (8 Replies)
Discussion started by: Rajib Podder
8 Replies
DateTime::Locale::da(3) 				User Contributed Perl Documentation				   DateTime::Locale::da(3)

NAME
DateTime::Locale::da SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'da' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Danish. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) mandag tirsdag onsdag torsdag fredag lordag sondag Abbreviated (format) man tir ons tor fre lor son Narrow (format) M T O T F L S Wide (stand-alone) mandag tirsdag onsdag torsdag fredag lordag sondag Abbreviated (stand-alone) man tir ons tor fre lor son Narrow (stand-alone) M T O T F L S Months Wide (format) januar februar marts april maj juni juli august september oktober november december Abbreviated (format) jan. feb. mar. apr. maj jun. jul. aug. sep. okt. nov. dec. Narrow (format) J F M A M J J A S O N D Wide (stand-alone) januar februar marts april maj juni juli august september oktober november december Abbreviated (stand-alone) jan feb mar apr maj jun jul aug sep okt nov dec Narrow (stand-alone) J F M A M J J A S O N D Quarters Wide (format) 1. kvartal 2. kvartal 3. kvartal 4. kvartal Abbreviated (format) K1 K2 K3 K4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1. kvartal 2. kvartal 3. kvartal 4. kvartal Abbreviated (stand-alone) K1 K2 K3 K4 Narrow (stand-alone) 1 2 3 4 Eras Wide f.Kr. e.Kr. Abbreviated f.Kr. e.Kr. Narrow f.Kr. e.Kr. Date Formats Full 2008-02-05T18:30:30 = tirsdag den 5. februar 2008 1995-12-22T09:05:02 = fredag den 22. december 1995 -0010-09-15T04:44:23 = lordag den 15. september -10 Long 2008-02-05T18:30:30 = 5. feb. 2008 1995-12-22T09:05:02 = 22. dec. 1995 -0010-09-15T04:44:23 = 15. sep. -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 = 05/02/08 1995-12-22T09:05:02 = 22/12/95 -0010-09-15T04:44:23 = 15/09/-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 = 18.30.30 UTC 1995-12-22T09:05:02 = 09.05.02 UTC -0010-09-15T04:44:23 = 04.44.23 UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 Short 2008-02-05T18:30:30 = 18.30 1995-12-22T09:05:02 = 09.05 -0010-09-15T04:44:23 = 04.44 Default 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 Datetime Formats Full 2008-02-05T18:30:30 = tirsdag den 5. februar 2008 18.30.30 UTC 1995-12-22T09:05:02 = fredag den 22. december 1995 09.05.02 UTC -0010-09-15T04:44:23 = lordag den 15. september -10 04.44.23 UTC Long 2008-02-05T18:30:30 = 5. feb. 2008 18:30:30 UTC 1995-12-22T09:05:02 = 22. dec. 1995 09:05:02 UTC -0010-09-15T04:44:23 = 15. sep. -10 04:44:23 UTC Medium 2008-02-05T18:30:30 = 05/02/2008 18.30.30 1995-12-22T09:05:02 = 22/12/1995 09.05.02 -0010-09-15T04:44:23 = 15/09/-010 04.44.23 Short 2008-02-05T18:30:30 = 05/02/08 18.30 1995-12-22T09:05:02 = 22/12/95 09.05 -0010-09-15T04:44:23 = 15/09/-10 04.44 Default 2008-02-05T18:30:30 = 05/02/2008 18.30.30 1995-12-22T09:05:02 = 22/12/1995 09.05.02 -0010-09-15T04:44:23 = 15/09/-010 04.44.23 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 tir 1995-12-22T09:05:02 = 22 fre -0010-09-15T04:44:23 = 15 lor H (H) 2008-02-05T18:30:30 = 18 1995-12-22T09:05:02 = 9 -0010-09-15T04:44:23 = 4 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 Hm (HH.mm) 2008-02-05T18:30:30 = 18.30 1995-12-22T09:05:02 = 09.05 -0010-09-15T04:44:23 = 04.44 hm (h.mm a) 2008-02-05T18:30:30 = 6.30 e.m. 1995-12-22T09:05:02 = 9.05 f.m. -0010-09-15T04:44:23 = 4.44 f.m. 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 e.m. 1995-12-22T09:05:02 = 9.05.02 f.m. -0010-09-15T04:44:23 = 4.44.23 f.m. M (M) 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 = tir. 5-2 1995-12-22T09:05:02 = fre. 22-12 -0010-09-15T04:44:23 = lor. 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 (MMM) 2008-02-05T18:30:30 = feb. 1995-12-22T09:05:02 = dec. -0010-09-15T04:44:23 = sep. MMMd (d. MMM) 2008-02-05T18:30:30 = 5. feb. 1995-12-22T09:05:02 = 22. dec. -0010-09-15T04:44:23 = 15. sep. MMMEd (E d MMM) 2008-02-05T18:30:30 = tir 5 feb. 1995-12-22T09:05:02 = fre 22 dec. -0010-09-15T04:44:23 = lor 15 sep. MMMMd (d. MMMM) 2008-02-05T18:30:30 = 5. februar 1995-12-22T09:05:02 = 22. december -0010-09-15T04:44:23 = 15. september MMMMEd (E, d. MMMM) 2008-02-05T18:30:30 = tir, 5. februar 1995-12-22T09:05:02 = fre, 22. december -0010-09-15T04:44:23 = lor, 15. september 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-yyyy) 2008-02-05T18:30:30 = 2-2008 1995-12-22T09:05:02 = 12-1995 -0010-09-15T04:44:23 = 9--010 yMEd (EEE. d-M-yyyy) 2008-02-05T18:30:30 = tir. 5-2-2008 1995-12-22T09:05:02 = fre. 22-12-1995 -0010-09-15T04:44:23 = lor. 15-9--010 yMMM (MMM y) 2008-02-05T18:30:30 = feb. 2008 1995-12-22T09:05:02 = dec. 1995 -0010-09-15T04:44:23 = sep. -10 yMMMEd (EEE. d. MMM y) 2008-02-05T18:30:30 = tir. 5. feb. 2008 1995-12-22T09:05:02 = fre. 22. dec. 1995 -0010-09-15T04:44:23 = lor. 15. sep. -10 yMMMM (MMMM y) 2008-02-05T18:30:30 = februar 2008 1995-12-22T09:05:02 = december 1995 -0010-09-15T04:44:23 = september -10 yQ (Q yyyy) 2008-02-05T18:30:30 = 1 2008 1995-12-22T09:05:02 = 4 1995 -0010-09-15T04:44:23 = 3 -010 yQQQ (QQQ y) 2008-02-05T18:30:30 = K1 2008 1995-12-22T09:05:02 = K4 1995 -0010-09-15T04:44:23 = K3 -10 yyMM (MM/yy) 2008-02-05T18:30:30 = 02/08 1995-12-22T09:05:02 = 12/95 -0010-09-15T04:44:23 = 09/-10 yyMMM (MMM yy) 2008-02-05T18:30:30 = feb. 08 1995-12-22T09:05:02 = dec. 95 -0010-09-15T04:44:23 = sep. -10 yyQ (Q. 'kvartal' yy) 2008-02-05T18:30:30 = 1. kvartal 08 1995-12-22T09:05:02 = 4. kvartal 95 -0010-09-15T04:44:23 = 3. kvartal -10 yyyy (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -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 yyyyMMM (MMM y) 2008-02-05T18:30:30 = feb. 2008 1995-12-22T09:05:02 = dec. 1995 -0010-09-15T04:44:23 = sep. -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week mandag 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.18.2 2017-10-06 DateTime::Locale::da(3)
All times are GMT -4. The time now is 10:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy