Sponsored Content
Top Forums Shell Programming and Scripting Extracting substrings from a string of variable length Post 302793071 by Nevergivup on Thursday 11th of April 2013 03:58:03 PM
Old 04-11-2013
Extracting substrings from a string of variable length

I have a string like
Code:
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
 

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. Programming

Accessing substrings by offset and length

Hi, I have a simple question... In C do we have a standard library function which will return the pointer to a substring at certain offset and having certain length... Ofcourse we should take care not to access beyond allocated length in the parent string and don't overwrite beyond allocated... (2 Replies)
Discussion started by: Vishnu
2 Replies

3. Shell Programming and Scripting

creating a fixed length output from a variable length input

Is there a command that sets a variable length? I have a input of a variable length field but my output for that field needs to be set to 32 char. Is there such a command? I am on a sun box running ksh Thanks (2 Replies)
Discussion started by: r1500
2 Replies

4. Shell Programming and Scripting

extracting substrings

Hi guys, I am stuck in this problem. Please help. I have two files. FILE1 (with records starting from '>' ) >TC1723_3 similar to Scific_A7Q9Q3 EMSPSQDYCDDYFKLTYPCTAGAQYYGRGALPVYWNYNYGAIGEALKLDLLNHPEYIEQN ATMAFQAAIWRWMNPMKKGQPSAHDAFVGNWKP >TC214_2 similar to Quiet_Ref100_Q8W2B2 Cluster;... (1 Reply)
Discussion started by: smriti_shridhar
1 Replies

5. Shell Programming and Scripting

Replace variable length numeric string

I have a customer who logged some cc and bank account numbers in their apache logs. I got the cc numbers x'd out with sed -e 's/args=\{16\}/args=XXXXXXXXXXXXXXXX/g' -e 's/cardnum=\{16\}/cardnum=XXXXXXXXXXXXXXXX/g'but that wasn't too difficult due to the value being 16 digits. The bank account... (7 Replies)
Discussion started by: mk4mzid
7 Replies

6. 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

7. Shell Programming and Scripting

filtering out duplicate substrings, regex string from a string

My input contains a single word lines. From each line data.txt prjtestBlaBlatestBlaBla prjthisBlaBlathisBlaBla prjthatBlaBladpthatBlaBla prjgoodBlaBladpgoodBlaBla prjgood1BlaBla123dpgood1BlaBla123 Desired output --> data_out.txt prjtestBlaBla prjthisBlaBla... (8 Replies)
Discussion started by: kchinnam
8 Replies

8. Shell Programming and Scripting

extracting substrings from variables

Hello Everyone, I am looking for a way to extract substrings to local variables. Here is the format of the string variable i am using : /var/x/www && /usr/x/share/doc && /etc/x/logs where the substrings i must extract are the "/var/x/www" and such. I was originally thinking of using... (15 Replies)
Discussion started by: jimmy75_13
15 Replies

9. 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

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::sr_Latn_YU(3) 			User Contributed Perl Documentation			   DateTime::Locale::sr_Latn_YU(3)

NAME
DateTime::Locale::sr_Latn_YU SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'sr_Latn_YU' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Serbian Latin. DATA
This locale inherits from the DateTime::Locale::sr_Latn_RS locale. It contains the following data. Days Wide (format) ponedeljak utorak sreda Xetvrtak petak subota nedelja Abbreviated (format) pon uto sre Xet pet sub ned Narrow (format) p u s X p s n Wide (stand-alone) ponedeljak utorak sreda Xetvrtak petak subota nedelja Abbreviated (stand-alone) pon uto sre Xet pet sub ned Narrow (stand-alone) p u s X p s n Months Wide (format) januar februar mart april maj jun jul avgust septembar oktobar novembar decembar Abbreviated (format) jan feb mar apr maj jun jul avg sep okt nov dec Narrow (format) j f m a m j j a s o n d Wide (stand-alone) januar februar mart april maj jun jul avgust septembar oktobar novembar decembar Abbreviated (stand-alone) jan feb mar apr maj jun jul avg 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) Q1 Q2 Q3 Q4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1. kvartal 2. kvartal 3. kvartal 4. kvartal Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide Pre nove ere Nove ere Abbreviated p. n. e. n. e Narrow p. n. e. n. e Date Formats Full 2008-02-05T18:30:30 = utorak, 05. februar 2008. 1995-12-22T09:05:02 = petak, 22. decembar 1995. -0010-09-15T04:44:23 = subota, 15. septembar -10. Long 2008-02-05T18:30:30 = 05. februar 2008. 1995-12-22T09:05:02 = 22. decembar 1995. -0010-09-15T04:44:23 = 15. septembar -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.-10. 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.-10. 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 = utorak, 05. februar 2008. 18.30.30 UTC 1995-12-22T09:05:02 = petak, 22. decembar 1995. 09.05.02 UTC -0010-09-15T04:44:23 = subota, 15. septembar -10. 04.44.23 UTC Long 2008-02-05T18:30:30 = 05. februar 2008. 18.30.30 UTC 1995-12-22T09:05:02 = 22. decembar 1995. 09.05.02 UTC -0010-09-15T04:44:23 = 15. septembar -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.-10. 04.44.23 Short 2008-02-05T18:30:30 = 5.2.08. 18.30 1995-12-22T09:05:02 = 22.12.95. 09.05 -0010-09-15T04:44:23 = 15.9.-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.-10. 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 Ed (E d.) 2008-02-05T18:30:30 = uto 5. 1995-12-22T09:05:02 = pet 22. -0010-09-15T04:44:23 = sub 15. EEEd (d EEE) 2008-02-05T18:30:30 = 5 uto 1995-12-22T09:05:02 = 22 pet -0010-09-15T04:44:23 = 15 sub hhmm (hh.mm a) 2008-02-05T18:30:30 = 06.30 popodne 1995-12-22T09:05:02 = 09.05 pre podne -0010-09-15T04:44:23 = 04.44 pre podne hhmmss (hh.mm.ss a) 2008-02-05T18:30:30 = 06.30.30 popodne 1995-12-22T09:05:02 = 09.05.02 pre podne -0010-09-15T04:44:23 = 04.44.23 pre podne 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 popodne 1995-12-22T09:05:02 = 9:05 pre podne -0010-09-15T04:44:23 = 4:44 pre podne 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 popodne 1995-12-22T09:05:02 = 9:05:02 pre podne -0010-09-15T04:44:23 = 4:44:23 pre podne 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, M-d) 2008-02-05T18:30:30 = uto, 2-5 1995-12-22T09:05:02 = pet, 12-22 -0010-09-15T04:44:23 = sub, 9-15 MMdd (MM-dd) 2008-02-05T18:30:30 = 02-05 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 09-15 MMM (LLL) 2008-02-05T18:30:30 = feb 1995-12-22T09:05:02 = dec -0010-09-15T04:44:23 = sep MMMd (MMM d.) 2008-02-05T18:30:30 = feb 5. 1995-12-22T09:05:02 = dec 22. -0010-09-15T04:44:23 = sep 15. MMMdd (dd.MMM) 2008-02-05T18:30:30 = 05.feb 1995-12-22T09:05:02 = 22.dec -0010-09-15T04:44:23 = 15.sep MMMEd (E d. MMM) 2008-02-05T18:30:30 = uto 5. feb 1995-12-22T09:05:02 = pet 22. dec -0010-09-15T04:44:23 = sub 15. sep MMMMd (MMMM d.) 2008-02-05T18:30:30 = februar 5. 1995-12-22T09:05:02 = decembar 22. -0010-09-15T04:44:23 = septembar 15. MMMMdd (dd. MMMM) 2008-02-05T18:30:30 = 05. februar 1995-12-22T09:05:02 = 22. decembar -0010-09-15T04:44:23 = 15. septembar MMMMEd (E MMMM d) 2008-02-05T18:30:30 = uto februar 5 1995-12-22T09:05:02 = pet decembar 22 -0010-09-15T04:44:23 = sub septembar 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, d. M. yyyy.) 2008-02-05T18:30:30 = uto, 5. 2. 2008. 1995-12-22T09:05:02 = pet, 22. 12. 1995. -0010-09-15T04:44:23 = sub, 15. 9. -010. yMMM (y MMM) 2008-02-05T18:30:30 = 2008 feb 1995-12-22T09:05:02 = 1995 dec -0010-09-15T04:44:23 = -10 sep yMMMEd (EEE, d. MMM y.) 2008-02-05T18:30:30 = uto, 5. feb 2008. 1995-12-22T09:05:02 = pet, 22. dec 1995. -0010-09-15T04:44:23 = sub, 15. sep -10. yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 februar 1995-12-22T09:05:02 = 1995 decembar -0010-09-15T04:44:23 = -10 septembar 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 Q1 1995-12-22T09:05:02 = 1995 Q4 -0010-09-15T04:44:23 = -10 Q3 yyMM (MM.yy) 2008-02-05T18:30:30 = 02.08 1995-12-22T09:05:02 = 12.95 -0010-09-15T04:44:23 = 09.-10 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. feb 08. 1995-12-22T09:05:02 = 22. dec 95. -0010-09-15T04:44:23 = 15. sep -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 yyQQQQ (QQQQ 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 (yyyy-MM) 2008-02-05T18:30:30 = 2008-02 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -010-09 yyyyMMMM (MMMM y.) 2008-02-05T18:30:30 = februar 2008. 1995-12-22T09:05:02 = decembar 1995. -0010-09-15T04:44:23 = septembar -10. Miscellaneous Prefers 24 hour time? Yes Local first day of the week ponedeljak 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::sr_Latn_YU(3)
All times are GMT -4. The time now is 03:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy