Sponsored Content
Full Discussion: Increment a column using awk
Top Forums Shell Programming and Scripting Increment a column using awk Post 302331727 by Ramesh_srk on Tuesday 7th of July 2009 04:42:12 AM
Old 07-07-2009
Try this,

cat <Filename> | sed 's/\~\!/\-/g' | awk -F'-' 'BEGIN{t=500} {print t"~\!"$2"~\!"$3"~\!"$4; t+=1}'
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk - Compare fields and increment variables

Hi, My first post to this group... I have a need to to parse a source file which is a capture from a network analyser. I have two fields that need to be checked: - Field 7 represents the packet length (an integer), and Field 4 represents a network address (e.g. 192.168.25.3) - The... (10 Replies)
Discussion started by: mv652
10 Replies

2. Shell Programming and Scripting

for each different entry in column 1 extract maximum values from column 2 in unix/awk

Hello, I have 2 columns (1st column has multiple entries but the corresponding values in the column 2 may be the same or different.) however I want to extract unique values for each entry in column 1 by assigning the max value from column 2 SDF4 -0.211654 SDF4 0.978068 ... (1 Reply)
Discussion started by: Diya123
1 Replies

3. Shell Programming and Scripting

awk or sed: change the color of a column w/o screwing up column spacing

Hey folks. I wrote a little awk script that summarizes /proc/net/dev info and then pipes it to the nix column command to set up column spacing appropriately. Here's some example output: Iface RxMBytes RxPackets RxErrs RxDrop TxMBytes TxPackets TxErrs TxDrop bond0 9 83830... (3 Replies)
Discussion started by: ryran
3 Replies

4. Shell Programming and Scripting

Increment existing column in file

Hi All, I have a file with 3 millions records in which 3rd column is same throughout say its value is 0 throughout.for example: Col1 Col2 Col3 Col4 A 1 0 5 B 2 0 6 C 3 0 7 D 4 0 9 I want my output as : Col1 Col2 Col3 Col4 A 1 ... (4 Replies)
Discussion started by: Pinky456
4 Replies

5. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

6. Shell Programming and Scripting

Create new file with increment column based on conditions

Hello, Using bash script, i need to process the following file: 887,86,,2013-11-06,1,10030,5,2,0,200,, 887,86,,2013-11-05,1,10030,5,2,0,199,, 887,138,,2013-11-06,1,10031,6,2,0,1610612736,, 887,164,,2013-11-06,1,10000,0,2,0,36000,, and to create a new file such as the below ... (2 Replies)
Discussion started by: JonhyDeep
2 Replies

7. Shell Programming and Scripting

Problems with awk (fatal error) and paste (two variables into one column-by-column)

Hello, I have a script extracting columns of useful numbers from a data file, and manipulating the numbers with awk commands. I have problems with my script... 1. There are two lines assigning numbers to $BaseForAveraging. If I use the commented line (the first one) and let the second one... (9 Replies)
Discussion started by: vgbraymond
9 Replies

8. Shell Programming and Scripting

Increment Column having Alphanumeric value in file

I want to replace a column(first and last) having an alphanumeric value in a file. Requirement : 1)All values in a Column must be unique and contain an incremented pattern “HCTV0096” for first column and “cafefeca0090” for last column 2)for uniquely identifying each value in column Numeric part... (6 Replies)
Discussion started by: ketanraut
6 Replies

9. Shell Programming and Scripting

Check increment values in column

Gents, I have a file where i would like to check the constant increment by 2 in column 2. 5450 1000 5450 1002 5450 1004 5450 1006 5465 1000 5465 1002 5465 1006 5465 1008 5550 1002 5550 1004 5550 1006 5550 1008 6830 1000 6830 1002 6830 1008 6830 1010 (6 Replies)
Discussion started by: jiam912
6 Replies

10. Shell Programming and Scripting

Increment with awk - how to define start value

Hello, I am running under ubuntu18.04 My question is about awk. inputfile 0wo010011oasasds sdjhsdjh=, u12812888 8jsjkahsjajnsanakn akjskjskj=, suhuhuhwx kskkxmsnnxsnjxsnjxsnjjnjjdi=, 22878ssssss Below code adds consecutive numbers when string = is found run_code: awk -F'=' -v OFS='='... (4 Replies)
Discussion started by: baris35
4 Replies
DateTime::Locale::bs(3) 				User Contributed Perl Documentation				   DateTime::Locale::bs(3)

NAME
DateTime::Locale::bs SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'bs' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Bosnian. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) Ponedjeljak Utorak Srijeda Xetvrtak Petak Subota Nedjelja Abbreviated (format) Pon Uto Sri Xet Pet Sub Ned Narrow (format) 2 3 4 5 6 7 1 Wide (stand-alone) Ponedjeljak Utorak Srijeda Xetvrtak Petak Subota Nedjelja Abbreviated (stand-alone) Pon Uto Sri Xet Pet Sub Ned Narrow (stand-alone) 2 3 4 5 6 7 1 Months Wide (format) Januar Februar Mart April Maj Juni Juli Avgust Septembar Oktobar Novembar Decembar Abbreviated (format) Jan Feb Mar Apr Maj Jun Jul Avg Sep Okt Nov Dec Narrow (format) 1 2 3 4 5 6 7 8 9 10 11 12 Wide (stand-alone) Januar Februar Mart April Maj Juni Juli Avgust Septembar Oktobar Novembar Decembar Abbreviated (stand-alone) Jan Feb Mar Apr Maj Jun Jul Avg Sep Okt Nov Dec Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Quarters Wide (format) Prvi kvartal Drugi kvartal TreXi kvartal Xetvrti kvartal Abbreviated (format) K1 K2 K3 K4 Narrow (format) 1 2 3 4 Wide (stand-alone) Prvi kvartal Drugi kvartal TreXi kvartal Xetvrti kvartal Abbreviated (stand-alone) K1 K2 K3 K4 Narrow (stand-alone) 1 2 3 4 Eras Wide BCE CE Abbreviated BC AD Narrow BC AD Date Formats Full 2008-02-05T18:30:30 = Utorak, 2008 Februar 05 1995-12-22T09:05:02 = Petak, 1995 Decembar 22 -0010-09-15T04:44:23 = Subota, -10 Septembar 15 Long 2008-02-05T18:30:30 = 2008 Februar 5 1995-12-22T09:05:02 = 1995 Decembar 22 -0010-09-15T04:44:23 = -10 Septembar 15 Medium 2008-02-05T18:30:30 = 2008 Feb 5 1995-12-22T09:05:02 = 1995 Dec 22 -0010-09-15T04:44:23 = -10 Sep 15 Short 2008-02-05T18:30:30 = 08/02/05 1995-12-22T09:05:02 = 95/12/22 -0010-09-15T04:44:23 = -10/09/15 Default 2008-02-05T18:30:30 = 2008 Feb 5 1995-12-22T09:05:02 = 1995 Dec 22 -0010-09-15T04:44:23 = -10 Sep 15 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, 2008 Februar 05 18:30:30 UTC 1995-12-22T09:05:02 = Petak, 1995 Decembar 22 09:05:02 UTC -0010-09-15T04:44:23 = Subota, -10 Septembar 15 04:44:23 UTC Long 2008-02-05T18:30:30 = 2008 Februar 5 18:30:30 UTC 1995-12-22T09:05:02 = 1995 Decembar 22 09:05:02 UTC -0010-09-15T04:44:23 = -10 Septembar 15 04:44:23 UTC Medium 2008-02-05T18:30:30 = 2008 Feb 5 18:30:30 1995-12-22T09:05:02 = 1995 Dec 22 09:05:02 -0010-09-15T04:44:23 = -10 Sep 15 04:44:23 Short 2008-02-05T18:30:30 = 08/02/05 18:30 1995-12-22T09:05:02 = 95/12/22 09:05 -0010-09-15T04:44:23 = -10/09/15 04:44 Default 2008-02-05T18:30:30 = 2008 Feb 5 18:30:30 1995-12-22T09:05:02 = 1995 Dec 22 09:05:02 -0010-09-15T04:44:23 = -10 Sep 15 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 Uto 1995-12-22T09:05:02 = 22 Pet -0010-09-15T04:44:23 = 15 Sub 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 (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 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 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 MMMEd (E MMM d) 2008-02-05T18:30:30 = Uto Feb 5 1995-12-22T09:05:02 = Pet Dec 22 -0010-09-15T04:44:23 = Sub Sep 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = Februar 5 1995-12-22T09:05:02 = Decembar 22 -0010-09-15T04:44:23 = Septembar 15 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, y-M-d) 2008-02-05T18:30:30 = Uto, 2008-2-5 1995-12-22T09:05:02 = Pet, 1995-12-22 -0010-09-15T04:44:23 = Sub, -10-9-15 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, y MMM d) 2008-02-05T18:30:30 = Uto, 2008 Feb 5 1995-12-22T09:05:02 = Pet, 1995 Dec 22 -0010-09-15T04:44:23 = Sub, -10 Sep 15 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 K1 1995-12-22T09:05:02 = 1995 K4 -0010-09-15T04:44:23 = -10 K3 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week Ponedjeljak 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::bs(3)
All times are GMT -4. The time now is 09:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy