Sponsored Content
Full Discussion: awk script row to column
Top Forums Shell Programming and Scripting awk script row to column Post 303016115 by buncit8 on Thursday 19th of April 2018 11:07:23 PM
Old 04-20-2018
awk script row to column

Hi..

I have data :
Code:
Report testing1 20180419 08:00
Report testing2 20180419 07:35
Report testing 20180419 08:01
Source = data1
Report testing4 20180419 08:05
Source = data1
Report testing5 20180419 08:10
Source = data2
Report testing6 20180419 08:01
Report testing7 20180419 08:19
Report testing8 20180419 08:15
Source = data2

Output will be :
Code:
Report testing1 20180419 08:00
Report testing2 20180419 07:35
Report testing 20180419 08:01 Source = data1
Report testing4 20180419 08:05 Source = data1
Report testing5 20180419 08:10 Source = data2
Report testing6 20180419 08:01
Report testing7 20180419 08:19
Report testing8 20180419 08:15 Source = data2


Need help for the script awk.

Thanks all
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Get value of last row and 6 column from awk

I want to get value of last row and 6 column from awk. Below is the format of my file. And RED one is my desired value. Actaully this stats usally update after every 1 hour so i want that every time i run the script i get the latest value. Ending time - 01:00:58 HOURLY CALL ATTEMPTS... (4 Replies)
Discussion started by: wakhan
4 Replies

2. UNIX for Dummies Questions & Answers

awk question row into column

I have a csv file: test1.csv with 26 columns Sample: Data collected Comp1,,,,,,,,,,,,,,,,,,,,,,,,,Average Number of Arrivals with non Zero,0,0,0,0,0,0,0,0,0,...,0 %Utilization,0.1,0.23,0.14,...,0.36 Data collected Comp2,,,,,,,,,,,,,,,,,,,,,,,,,Average Number of Arrivals with non... (2 Replies)
Discussion started by: calitiggr
2 Replies

3. Shell Programming and Scripting

AWK Script - Print a column - within a Row Range

Hi, Please read the whole thread. I have been working on this script below. It works fine, feel free to copy and test with the INPUT File below as well. example: PACKET DATA PROTOCOL CONTEXT DATA APNID PDPADD EQOSID VPAA PDPCH PDPTY PDPID 10 ... (6 Replies)
Discussion started by: panapty
6 Replies

4. Shell Programming and Scripting

Subtracting each row from the first row in a single column file using awk

Hi Friends, I have a single column data like below. 1 2 3 4 5 I need the output like below. 0 1 2 3 4 where each row (including first row) subtracting from first row and the result should print below like the way shown in output file. Thanks Sid (11 Replies)
Discussion started by: ks_reddy
11 Replies

5. Shell Programming and Scripting

awk transpose row into 2 field column

Need to transpose every 2 fields of a row into a single 2 field column. input 4 135 114 76 217 30 346 110 5 185 115 45 218 85 347 125 6 85 116 130 220 65 352 95 11 30 117 55 221 42 355 75 16 72 118 55 224 37 357 430 17 30 119 55 225 40 358 62 21 52 120 65 232 480 360 180 ....... (8 Replies)
Discussion started by: sdf
8 Replies

6. UNIX for Dummies Questions & Answers

append column and row header to a file in awk script.

Hi! Is there a way to append column and row header to a file in awk script. For example if I have Jane F 39 manager Carlos M 40 system administrator Sam F 20 programmer and I want it to be # name gend age occup 1 Jane F 39 manager 2 Carlos M ... (4 Replies)
Discussion started by: FUTURE_EINSTEIN
4 Replies

7. Shell Programming and Scripting

awk - script help: column to row format of data allignment?

Experts Good day, I have the following data, file1 BRAAGRP1 A2X B2X C2X D2X BRBGRP12 A3X B3X Z10 D09 BRC1GRP2 LO01 (4 Replies)
Discussion started by: rveri
4 Replies

8. UNIX for Dummies Questions & Answers

awk to print first row with forth column and last row with fifth column in each file

file with this content awk 'NR==1 {print $4} && NR==2 {print $5}' file The error is shown with syntax error; what can be done (4 Replies)
Discussion started by: cdfd123
4 Replies

9. Shell Programming and Scripting

Transpose column to row - awk

Hi there, I have a small csv file example below: source,cu_001,cu_001_volume,cu_001_mass,cu_002,cu_002_volume,cu_002_mass,cu_003,cu_003_volume,cu_003_mass ja116,1.33,3024000,9374400,1.54,3026200,9375123,1.98,3028000,9385512 I want to transpose columns to rows starting at the second... (3 Replies)
Discussion started by: theflamingmoe
3 Replies

10. UNIX for Beginners Questions & Answers

Script to do column to row in awk

Hi , Can anyone help me suggesting - how to do the below trick with awk Input 120 130 140 210 310 410 645 729 800 Output 120 130 140 (6 Replies)
Discussion started by: Indra2011
6 Replies
Log::Report::Dispatcher::LogDispatch(3pm)		User Contributed Perl Documentation		 Log::Report::Dispatcher::LogDispatch(3pm)

NAME
Log::Report::Dispatcher::LogDispatch - send messages to Log::Dispatch back-end INHERITANCE
Log::Report::Dispatcher::LogDispatch is a Log::Report::Dispatcher SYNOPSIS
use Log::Dispatch::File; dispatcher Log::Dispatch::File => 'logger', accept => 'NOTICE-' , filename => 'logfile', to_level => [ 'ALERT-' => 'err' ]; # disable default dispatcher dispatcher close => 'logger'; DESCRIPTION
This dispatchers produces output to and "Log::Dispatch" back-end. (which will NOT be automatically installed for you). The REASON for a message often uses names which are quite similar to the log-levels used by Log::Dispatch. However: they have a different approach. The REASON of Log::Report limits the responsibility of the programmer to indicate the cause of the message: whether it was able to handle a certain situation. The Log::Dispatch levels are there for the user's of the program. However: the programmer does not known anything about the application (in the general case). This is cause of much of the trickery in Perl programs. The default translation table is list below. You can change the mapping using new(to_level). See example in SYNOPSIS. METHODS
Constructors $obj->close See "Constructors" in Log::Report::Dispatcher Log::Report::Dispatcher::LogDispatch->new(TYPE, NAME, OPTIONS) The Log::Dispatch infrastructure has quite a large number of output TYPEs, each extending the Log::Dispatch::Output base-class. You do not create these objects yourself: Log::Report is doing it for you. The Log::Dispatch back-ends are very careful with validating their parameters, so you will need to restrict the options to what is supported for the specific back-end. See their respective manual-pages. The errors produced by the back-ends quite horrible and untranslated, sorry. -Option --Defined in --Default accept Log::Report::Dispatcher depend on mode callbacks [] charset Log::Report::Dispatcher <undef> format_reason Log::Report::Dispatcher 'LOWERCASE' locale Log::Report::Dispatcher <system locale> max_level undef min_level debug mode Log::Report::Dispatcher 'NORMAL' to_level [] accept => REASONS callbacks => CODE|ARRAY-of-CODE See Log::Dispatch::Output. charset => CHARSET format_reason => 'UPPERCASE'|'LOWERCASE'|'UCFIRST'|'IGNORE'|CODE locale => LOCALE max_level => LEVEL Like "min_level". min_level => LEVEL Restrict the messages which are passed through based on the LEVEL, so after the reason got translated into a Log::Dispatch compatible LEVEL. The default will use Log::Report restrictions only. mode => 'NORMAL'|'VERBOSE'|'ASSERT'|'DEBUG'|0..3 to_level => ARRAY-of-PAIRS See reasonToLevel(). Accessors $obj->backend Returns the Log::Dispatch::Output object which is used for logging. $obj->isDisabled See "Accessors" in Log::Report::Dispatcher $obj->mode See "Accessors" in Log::Report::Dispatcher $obj->name See "Accessors" in Log::Report::Dispatcher $obj->needs See "Accessors" in Log::Report::Dispatcher $obj->type See "Accessors" in Log::Report::Dispatcher Logging $obj->collectLocation Log::Report::Dispatcher::LogDispatch->collectLocation See "Logging" in Log::Report::Dispatcher $obj->collectStack([MAXDEPTH]) Log::Report::Dispatcher::LogDispatch->collectStack([MAXDEPTH]) See "Logging" in Log::Report::Dispatcher $obj->log(HASH-of-OPTIONS, REASON, MESSAGE) See "Logging" in Log::Report::Dispatcher $obj->reasonToLevel(REASON) Returns a level which is understood by Log::Dispatch, based on a translation table. This can be changed with new(to_level). $obj->stackTraceLine(OPTIONS) Log::Report::Dispatcher::LogDispatch->stackTraceLine(OPTIONS) See "Logging" in Log::Report::Dispatcher $obj->translate(HASH-of-OPTIONS, REASON, MESSAGE) See "Logging" in Log::Report::Dispatcher SEE ALSO
This module is part of Log-Report distribution version 0.94, built on August 23, 2011. Website: http://perl.overmeer.net/log-report/ LICENSE
Copyrights 2007-2011 by Mark Overmeer. For other contributors see ChangeLog. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.14.2 2011-08-23 Log::Report::Dispatcher::LogDispatch(3pm)
All times are GMT -4. The time now is 05:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy