Sponsored Content
Top Forums Shell Programming and Scripting How to grouping time and based on value with multiple pattern? Post 303036968 by RudiC on Friday 19th of July 2019 05:47:54 AM
Old 07-19-2019
Try
Code:
awk -F: '{sub (/\[/, "", $1); sub (/"}/, "", $NF); CNT[$1 ":" $2 " " $NF]++} END {for (c in CNT) print c, CNT[c]}' file
2019-07-18T01:14  Insufficient balance 1
2019-07-18T01:09  Error 1
2019-07-18T01:14  Invalid Transaction 1
2019-07-18T01:09  Invalid Transaction 1
2019-07-18T01:08  Invalid Transaction 1
2019-07-18T01:08  Internal Error 1

Your expected result can't be produced as there are no two identical time/value pairs in your sampe file.
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split a file into multiple files based on the input pattern

I have a file with lines something like. ...... 123_start ...... ....... 123_end .... ..... 456_start ...... ..... 456_end .... ..... 789_start .... .... 789_end (6 Replies)
Discussion started by: abinash
6 Replies

2. Shell Programming and Scripting

Splitting large file into multiple files in unix based on pattern

I need to write a shell script for below scenario My input file has data in format: qwerty0101TWE 12345 01022005 01022005 datainala alanfernanded 26 qwerty0101mXZ 12349 01022005 06022008 datainalb johngalilo 28 qwerty0101TWE 12342 01022005 07022009 datainalc hitalbert 43 qwerty0101CFG 12345... (19 Replies)
Discussion started by: jimmy12
19 Replies

3. UNIX for Dummies Questions & Answers

print multiple lines from text file based on pattern list

I have a text file with a list of items/patterns: ConsensusfromCGX_alldays_trimmedcollapsedfilteredreadscontiglist(229095contigs)contig12238 ConsensusfromCGX_alldays_trimmedcollapsedfilteredreadscontiglist(229095contigs)contig34624... (1 Reply)
Discussion started by: Oyster
1 Replies

4. Shell Programming and Scripting

split XML file into multiple files based on pattern

Hello, I am using awk to split a file into multiple files using command: nawk '{ if ( $1 == "<process" ) { n=split($2, arr, "\""); file=arr } print > file }' processes.xml <process name="Process1.process"> ... (3 Replies)
Discussion started by: chiru_h
3 Replies

5. Shell Programming and Scripting

grouping based on first column

I do have a tab delimited file of the following format a_1 rt a_1 st_2 a_1 st_3 a_2 bt_2 a_2 st_er b_2 st_2 b_2 st_32 S_1 rt_8 S_1 rt_64 I want to cut short the above file and group the file based on the first column like below. a_1 rt st_2 st_3 a_2 bt_2 st_er b_2 st_2... (1 Reply)
Discussion started by: Lucky Ali
1 Replies

6. UNIX for Advanced & Expert Users

Moving multiple files based on the pattern

I want to search for a particular file name patterns and move them to a specific folder, is it possible to do it with awk or sed? (1 Reply)
Discussion started by: rudoraj
1 Replies

7. Shell Programming and Scripting

Multiple File Rename based on pattern - one line

All, I wanted to copy the files From: Daily_XYZ_TEST_1.csv Daily_XYZ_TEST_2.csv Daily_XYZ_TEST_3.csv Daily_XYZ_TEST_4.csv To: Daily_ABC_TEST_1.csv Daily_ABC_TEST_2.csv Daily_ABC_TEST_3.csv Daily_ABC_TEST_4.csv I have tried the rename command but it is not working (5 Replies)
Discussion started by: alfredo123
5 Replies

8. Shell Programming and Scripting

Split a text file into multiple pages based on pattern

Hi, I have a text file (attached the sample). I have also, attached the way the way the files need to be split. We get this file, that will either have 24 Jurisdictions, or will miss some and retain some. Like in the attached sample file, there are only Jurisdictions 03,11,14,15, 20 and 30.... (3 Replies)
Discussion started by: ebsus
3 Replies

9. UNIX for Beginners Questions & Answers

Consternation of multiple file names based on naming pattern

Hi, I have the following reports that get generated every 1 hour and this is my requirement: 1. 5 reports get generated every hour with the names "Report.Dddmmyy.Thhmiss.CTLR" "Report.Dddmmyy.Thhmiss.ACCD" "Report.Dddmmyy.Thhmiss.BCCD" "Report.Dddmmyy.Thhmiss.CCCD"... (1 Reply)
Discussion started by: Jesshelle David
1 Replies

10. UNIX for Advanced & Expert Users

Concatenation of multiple files based on file pattern

Hi, I have the following reports that get generated every 1 hour and this is my requirement: 1. 5 reports get generated every hour with the names "Report.Dddmmyy.Thhmiss.CTLR" "Report.Dddmmyy.Thhmiss.ACCD" "Report.Dddmmyy.Thhmiss.BCCD" "Report.Dddmmyy.Thhmiss.CCCD"... (1 Reply)
Discussion started by: Jesshelle David
1 Replies
CAIROSTATUS(3)								 1							    CAIROSTATUS(3)

The CairoStatus class

INTRODUCTION
CairoStatus is used to indicate errors that can occur when using Cairo. In some cases it is returned directly by functions. but when using CairoContext, the last error, if any, is stored in the object and can be retrieved with CairoContext::status or cairo_status(3). New entries may be added in future versions. Use Cairo::statusToString or cairo_status_to_string(3) to get a human-readable representation of an error message. CLASS SYNOPSIS
CairoStatus CairoStatus Constants o const integer$CairoStatus::SUCCESS0 o const integer$CairoStatus::NO_MEMORY1 o const integer$CairoStatus::INVALID_RESTORE2 o const integer$CairoStatus::INVALID_POP_GROUP3 o const integer$CairoStatus::NO_CURRENT_POINT4 o const integer$CairoStatus::INVALID_MATRIX5 o const integer$CairoStatus::INVALID_STATUS6 o const integer$CairoStatus::NULL_POINTER7 o const integer$CairoStatus::INVALID_STRING8 o const integer$CairoStatus::INVALID_PATH_DATA9 o const integer$CairoStatus::READ_ERROR10 o const integer$CairoStatus::WRITE_ERROR11 o const integer$CairoStatus::SURFACE_FINISHED12 o const integer$CairoStatus::SURFACE_TYPE_MISMATCH13 o const integer$CairoStatus::PATTERN_TYPE_MISMATCH14 o const integer$CairoStatus::INVALID_CONTENT15 o const integer$CairoStatus::INVALID_FORMAT16 o const integer$CairoStatus::INVALID_VISUAL17 o const integer$CairoStatus::FILE_NOT_FOUND18 o const integer$CairoStatus::INVALID_DASH19 o const integer$CairoStatus::INVALID_DSC_COMMENT20 o const integer$CairoStatus::INVALID_INDEX21 o const integer$CairoStatus::CLIP_NOT_REPRESENTABLE22 o const integer$CairoStatus::TEMP_FILE_ERROR23 o const integer$CairoStatus::INVALID_STRIDE24 PREDEFINED CONSTANTS
o CairoStatus::SUCCESS -No error has occurred o CairoStatus::NO_MEMORY -Out of memory o CairoStatus::INVALID_RESTORE -cairo_restore(3) called without matching cairo_save(3) o CairoStatus::INVALID_POP_GROUP -No saved group to pop o CairoStatus::NO_CURRENT_POINT -No current point defined o CairoStatus::INVALID_MATRIX -Invalid matrix (not invertible) o CairoStatus::INVALID_STATUS -Invalid value for an input CairoStatus> o CairoStatus::NULL_POINTER -Null pointer o CairoStatus::INVALID_STRING -Input string not valid UTF-8 string o CairoStatus::INVALID_PATH_DATA -Input path data not valid o CairoStatus::READ_ERROR -Error while reading from input stream o CairoStatus::WRITE_ERROR -Error while writing to output stream o CairoStatus::SURFACE_FINISHED -Target surface has been finished o CairoStatus::SURFACE_TYPE_MISMATCH -The surface type is not appropriate for the operation o CairoStatus::PATTERN_TYPE_MISMATCH -The pattern type is not appropriate for the operation o CairoStatus::INVALID_CONTENT -Invalid value for an input CairoContent o CairoStatus::INVALID_FORMAT -Invalid value for an input CairoFormat o CairoStatus::INVALID_VISUAL -Invalid value for an input Visual o CairoStatus::FILE_NOT_FOUND -File not found o CairoStatus::INVALID_DASH -Invalid value for a dash setting o CairoStatus::INVALID_DSC_COMMENT -Invalid value for a DSC comment o CairoStatus::INVALID_INDEX -Invalid index passed to getter o CairoStatus::CLIP_NOT_REPRESENTABLE -Clip region not representable in desired format o CairoStatus::TEMP_FILE_ERROR -Error creating or writing to a temporary file o CairoStatus::INVALID_STRIDE -Invalid value for CairoStride PHP Documentation Group CAIROSTATUS(3)
All times are GMT -4. The time now is 10:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy