Sponsored Content
Top Forums Shell Programming and Scripting Insert rows with computations of next row Post 302147183 by summer_cherry on Sunday 25th of November 2007 09:35:43 PM
Old 11-25-2007
awk

Hi,

code:
Code:
nawk 'BEGIN{format="%s-%02dz %6f";n=0}
{
temp=substr($1,12,2)
t=substr($1,1,10)
if (temp=="00")
{
	vin=sprintf(format,t,temp,$2)
	out[n]=vin
	n++
}
else
{	
	num=$2/3
	vin=sprintf(format,t,temp-2,num)
	out[n]=vin
	n++
	vin=sprintf(format,t,temp-1,num)
	out[n]=vin
	n++
	vin=sprintf(format,t,temp,num)
	out[n]=vin
	n++
}
}
END{
for (i=0;i<=n;i++)
print out[i]
}' filename

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Concatenate 2 rows into 1 row

I need to search a file for two values (valueA & valueB). ValueA will be on a different row than valueB, and concatenate the two together on the same row of my output. Example: search input file for strings "node" and "OS", combine the two results into one row input node A text text OS... (4 Replies)
Discussion started by: indianadoug
4 Replies

2. UNIX for Dummies Questions & Answers

insert header row into .xls

Hello, I am building an .xls file extracting info from a DB to be eventually emailed. All is good except how do I put in a header row.. like date, name of report etc. before the columns with the actual column name and data? Thanks for any assistance.. the below is after I have signed into... (11 Replies)
Discussion started by: Tish
11 Replies

3. Shell Programming and Scripting

How to insert data befor some field in a row of data depending up on values in row

Hi I need to do some thing like "find and insert before that " in a file which contains many records. This will be clear with the following example. The original data record should be some thing like this 60119827 RTMS_LOCATION_CDR INSTANT_POSITION_QUERY 1236574686123083rtmssrv7 ... (8 Replies)
Discussion started by: aemunathan
8 Replies

4. Shell Programming and Scripting

insert txt in the row

hi i am having text file like this 444 raju 666 ranga Clerk 999 rani officer 111 juhi i want to get the out put as 444 raju NA 666 ranga Clerk 999 rani officer 111 juhi NA pls help (5 Replies)
Discussion started by: suryanarayana
5 Replies

5. UNIX for Advanced & Expert Users

convert rows to single row

Hi I want to convert multiple rows ro single row ,I have tried with below one but I am not getting what I am expecting.Please any idea a.txt conn1=stg conn2=dev path=\xxx\a1.txt fre=a conn1=stg conn2=dev path=\xxx\a2.txt freq=a awk '/a/{ORS=" "}{print}END{print "\n"}'... (5 Replies)
Discussion started by: akil
5 Replies

6. UNIX for Advanced & Expert Users

Converting rows to a single row

Hi all I have a file as below : Development System User Production i want to convert the file to below format: "Development","System","User","Production" Is it possible with UNIX ? if so can you please give me some direction on it ? Thanks, Satya Use code tags please, ty. (10 Replies)
Discussion started by: satyaranjon
10 Replies

7. UNIX for Dummies Questions & Answers

Insert rows with some rules??

Hi, I am rather new to Unix/Linus. I have this problem that I would like to solve using unix. Here is what I have start stop expression 1 5 15 2 6 10 I want a output like this position expression 1 15 2 25 3 ... (1 Reply)
Discussion started by: wanghlv
1 Replies

8. Shell Programming and Scripting

Print various rows in one row

I have this in a file 11.22.33.44 yyyyyyuser With awk/sed, I need this to be output as follows alias server.domain.com='ssh yyyyyyuser@11.22.33.44' (4 Replies)
Discussion started by: anil510
4 Replies

9. UNIX for Dummies Questions & Answers

Insert row into empty file...how?

Greetings: I generate an empty flat file just fine when there's no data returned from my process, as the customer wants one always (using the 1st line of the below script). However, they also want at least the column names in this flat file (row 1, the only row to be in the emply file). I'm... (7 Replies)
Discussion started by: Benrosa
7 Replies

10. Shell Programming and Scripting

Splitting single row into multiple rows based on for every 10 digits of last field of the row

Hi ALL, We have requirement in a file, i have multiple rows. Example below: Input file rows 01,1,102319,0,0,70,26,U,1,331,000000113200000011920000001212 01,1,102319,0,1,80,20,U,1,241,00000059420000006021 I need my output file should be as mentioned below. Last field should split for... (4 Replies)
Discussion started by: kotra
4 Replies
DateTime::Locale::fur(3)				User Contributed Perl Documentation				  DateTime::Locale::fur(3)

NAME
DateTime::Locale::fur SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'fur' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Friulian. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) lunis martars miercus joibe vinars sabide domenie Abbreviated (format) lun mar mie joi vin sab dom Narrow (format) L M M J V S D Wide (stand-alone) lunis martars miercus joibe vinars sabide domenie Abbreviated (stand-alone) lun mar mie joi vin sab dom Narrow (stand-alone) L M M J V S D Months Wide (format) Zenar Fevrar Marc Avril Mai Jugn Lui Avost Setembar Otubar Novembar Dicembar Abbreviated (format) Zen Fev Mar Avr Mai Jug Lui Avo Set Otu Nov Dic Narrow (format) Z F M A M J L A S O N D Wide (stand-alone) Zenar Fevrar Marc Avril Mai Jugn Lui Avost Setembar Otubar Novembar Dicembar Abbreviated (stand-alone) Zen Fev Mar Avr Mai Jug Lui Avo Set Otu Nov Dic Narrow (stand-alone) Z F M A M J L A S O N D Quarters Wide (format) Prin trimestri Secont trimestri Tierc trimestri Cuart trimestri Abbreviated (format) T1 T2 T3 T4 Narrow (format) 1 2 3 4 Wide (stand-alone) Prin trimestri Secont trimestri Tierc trimestri Cuart trimestri Abbreviated (stand-alone) T1 T2 T3 T4 Narrow (stand-alone) 1 2 3 4 Eras Wide pdC ddC Abbreviated pdC ddC Narrow pdC ddC Date Formats Full 2008-02-05T18:30:30 = martars 5 di Fevrar dal 2008 1995-12-22T09:05:02 = vinars 22 di Dicembar dal 1995 -0010-09-15T04:44:23 = sabide 15 di Setembar dal -10 Long 2008-02-05T18:30:30 = 5 di Fevrar dal 2008 1995-12-22T09:05:02 = 22 di Dicembar dal 1995 -0010-09-15T04:44:23 = 15 di Setembar dal -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 = martars 5 di Fevrar dal 2008 18:30:30 UTC 1995-12-22T09:05:02 = vinars 22 di Dicembar dal 1995 09:05:02 UTC -0010-09-15T04:44:23 = sabide 15 di Setembar dal -10 04:44:23 UTC Long 2008-02-05T18:30:30 = 5 di Fevrar dal 2008 18:30:30 UTC 1995-12-22T09:05:02 = 22 di Dicembar dal 1995 09:05:02 UTC -0010-09-15T04:44:23 = 15 di Setembar dal -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 mar 1995-12-22T09:05:02 = 22 vin -0010-09-15T04:44:23 = 15 sab 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 p. 1995-12-22T09:05:02 = 9:05 a. -0010-09-15T04:44:23 = 4:44 a. 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 p. 1995-12-22T09:05:02 = 9:05:02 a. -0010-09-15T04:44:23 = 4:44:23 a. 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 = mar 5/2 1995-12-22T09:05:02 = vin 22/12 -0010-09-15T04:44:23 = sab 15/9 MMd (d/MM) 2008-02-05T18:30:30 = 5/02 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/09 MMM (LLL) 2008-02-05T18:30:30 = Fev 1995-12-22T09:05:02 = Dic -0010-09-15T04:44:23 = Set MMMd (d MMM) 2008-02-05T18:30:30 = 5 Fev 1995-12-22T09:05:02 = 22 Dic -0010-09-15T04:44:23 = 15 Set MMMEd (E d MMM) 2008-02-05T18:30:30 = mar 5 Fev 1995-12-22T09:05:02 = vin 22 Dic -0010-09-15T04:44:23 = sab 15 Set MMMMd (d 'di' MMMM) 2008-02-05T18:30:30 = 5 di Fevrar 1995-12-22T09:05:02 = 22 di Dicembar -0010-09-15T04:44:23 = 15 di Setembar MMMMEd (E d MMMM) 2008-02-05T18:30:30 = mar 5 Fevrar 1995-12-22T09:05:02 = vin 22 Dicembar -0010-09-15T04:44:23 = sab 15 Setembar 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 = mar, 5/2/2008 1995-12-22T09:05:02 = vin, 22/12/1995 -0010-09-15T04:44:23 = sab, 15/9/-010 yMMM (MMM y) 2008-02-05T18:30:30 = Fev 2008 1995-12-22T09:05:02 = Dic 1995 -0010-09-15T04:44:23 = Set -10 yMMMEd (EEE d MMM y) 2008-02-05T18:30:30 = mar 5 Fev 2008 1995-12-22T09:05:02 = vin 22 Dic 1995 -0010-09-15T04:44:23 = sab 15 Set -10 yMMMM (LLLL 'dal' y) 2008-02-05T18:30:30 = Fevrar dal 2008 1995-12-22T09:05:02 = Dicembar dal 1995 -0010-09-15T04:44:23 = Setembar dal -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 = T1 2008 1995-12-22T09:05:02 = T4 1995 -0010-09-15T04:44:23 = T3 -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 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = Fevrar 2008 1995-12-22T09:05:02 = Dicembar 1995 -0010-09-15T04:44:23 = Setembar -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week lunis 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::fur(3)
All times are GMT -4. The time now is 10:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy