Sponsored Content
Top Forums Shell Programming and Scripting Extract paragraphs and count them Post 302993791 by dsid on Tuesday 14th of March 2017 01:01:07 PM
Old 03-14-2017
This is working perfect
Code:
 $./drysdalk_exclm_pattern.sh "Warning*"
institution,message
00000007,No transactions processed!
00000007,PROCESSING ERROR! - check log for error messages.
00000007,Processing Failed For Transaction!
00000029,Non-financial original Slip Not Found !
00000029,Original presentment Not Found !
00000029,Processing Failed For Transaction!
00000041,Non-financial original Slip Not Found !
00000041,Non-financial original Slip Not Found !
00000041,Original presentment Not Found !
00000041,Original presentment Not Found !
00000041,Processing Failed For Transaction!
00000041,Processing Failed For Transaction!
00000046,Transaction type of chargeback is not the same as that of original presentment.
00000046,Transaction type of chargeback is not the same as that of original presentment.
00000050,Non-financial original Slip Not Found !
00000050,Non-financial original Slip Not Found !
00000050,Original presentment Not Found !
00000050,Original presentment Not Found !
00000050,Processing Failed For Transaction!
00000050,Processing Failed For Transaction!

But with exclamation is not working. It seems it is calling bash history. Not sure why it is doing this

Code:
 $./drysdalk_exclm_pattern.sh "Warning !"
-bash: !": event not found

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to extract paragraphs from file in BASH script followed by prefix ! , !! and !!!

I]hi all i am in confusion since last 2 days :( i posted thraed yesterday and some friends did help but still i couldnt get solution to my problem let it be very clear i have a long log file of alkatel switch and i have to seperate the minor major and critical alarms shown by ! , !! and !!!... (6 Replies)
Discussion started by: nabmufti
6 Replies

2. Shell Programming and Scripting

how to filter out some paragraphs in a file

Hi, I am trying to filter out those paragraphs that contains 'CONNECT', 'alter system switch logfile'. That means say the input file is : ------------------------------------------------------- Wed Jun 7 00:32:31 2006 ACTION : 'CONNECT' CLIENT USER: prdadm CLIENT TERMINAL: Wed Jun 7... (7 Replies)
Discussion started by: cnlhap
7 Replies

3. Shell Programming and Scripting

How to extract specific data and count number containing sets from a file?

Hello everybody! I am quit new here and hope you can help me. Using an awk script I am trying to extract data from several files. The structure of the input files is as follows: TimeStep parameter1 parameter2 parameter3 parameter4 e.g. 1 X Y Z L 1 D H Z I 1 H Y E W 2 D H G F 2 R... (2 Replies)
Discussion started by: Daniel8472
2 Replies

4. Shell Programming and Scripting

Extract string from multiple file based on line count number

Hi, I search all forum, but I can not find solutions of my problem :( I have multiple files (5000 files), inside there is this data : FILE 1: 1195.921 -898.995 0.750312E-02-0.497526E-02 0.195382E-05 0.609417E-05 -2021.287 1305.479-0.819754E-02 0.107572E-01 0.313018E-05 0.885066E-05 ... (15 Replies)
Discussion started by: guns
15 Replies

5. Shell Programming and Scripting

Extract paragraphs under conditions

Hi all, I want to extract some paragraphs out of a file under certain conditions. - The paragraph must start with 'fmri' - The paragraph must contain the string 'restarter svc:/system/svc/restarter:default' My input is like that : fmri svc:/system/vxpbx:default state_time Wed... (4 Replies)
Discussion started by: Armoric
4 Replies

6. Shell Programming and Scripting

Need help with sorting in paragraphs

I am very new to shell scripting, current try to do a sorting of a text file in paragraphs with ksh script. example: File content: A1100001 line 1 = "testing" line 2 = something, line 3 = 100 D1200003 line 1 = "testing" line 2 = something, line 3 = 100 B1200003 line 1 =... (3 Replies)
Discussion started by: gavin_L
3 Replies

7. Shell Programming and Scripting

Extract and count number of Duplicate rows

Hi All, I need to extract duplicate rows from a file and write these bad records into another file. And need to have a count of these bad records. i have a command awk ' {s++} END { for(i in s) { if(s>1) { print i } } }' ${TMP_DUPE_RECS}>>${TMP_BAD_DATA_DUPE_RECS}... (5 Replies)
Discussion started by: Arun Mishra
5 Replies

8. Shell Programming and Scripting

Skip the delimiter with in double quotes and count the number of delimiters during data extract

Hi All, I'm stuck-up in finding a way to skip the delimiter which come within double quotes using awk or any other better option. can someone please help me out. Below are the details: Delimited: | Sample data: 742433154|"SYN|THESIS MED CHEM PTY.... (2 Replies)
Discussion started by: BrahmaNaiduA
2 Replies

9. Shell Programming and Scripting

Extract count of string in all files and display on date wise

Hi All, hope you all are doing well! I kindly ask you for shell scripting help, here is the description: I have huge number of files shown below on date wise, which contains different strings(numbers you can say) including 505001 and 602001. ... (14 Replies)
Discussion started by: VasuKukkapalli
14 Replies

10. UNIX for Beginners Questions & Answers

Extract lines that have dupliucate and count them

Dear friends i have big file and i want to export the filw with new column for the lines that have same duplicate value in first column : ex : , ex : -bash-3.00$ cat INTCONT-IS.CSV M205-00-106_AMDRN:1-0-6-22,12-662-4833,intContact,2016-11-15 02:32:16,50... (9 Replies)
Discussion started by: is2_egypt
9 Replies
Mojo::Transaction::WebSocket(3pm)			User Contributed Perl Documentation			 Mojo::Transaction::WebSocket(3pm)

NAME
Mojo::Transaction::WebSocket - WebSocket transaction container SYNOPSIS
use Mojo::Transaction::WebSocket; my $ws = Mojo::Transaction::WebSocket->new; DESCRIPTION
Mojo::Transaction::WebSocket is a container for WebSocket transactions as described in RFC 6455. Note that 64bit frames require a Perl with 64bit integer support, or they are limited to 32bit. EVENTS
Mojo::Transaction::WebSocket inherits all events from Mojo::Transaction and can emit the following new ones. "drain" $ws->on(drain => sub { my $ws = shift; ... }); Emitted once all data has been sent. $ws->on(drain => sub { my $ws = shift; $ws->send(time); }); "frame" $ws->on(frame => sub { my ($ws, $frame) = @_; ... }); Emitted when a WebSocket frame has been received. $ws->unsubscribe('frame'); $ws->on(frame => sub { my ($ws, $frame) = @_; say "FIN: $frame->[0]"; say "RSV1: $frame->[1]"; say "RSV2: $frame->[2]"; say "RSV3: $frame->[3]"; say "Opcode: $frame->[4]"; say "Payload: $frame->[5]"; }); "message" $ws->on(message => sub { my ($ws, $message) = @_; ... }); Emitted when a complete WebSocket message has been received. $ws->on(message => sub { my ($ws, $message) = @_; say "Message: $message"; }); ATTRIBUTES
Mojo::Transaction::WebSocket inherits all attributes from Mojo::Transaction and implements the following new ones. "handshake" my $handshake = $ws->handshake; $ws = $ws->handshake(Mojo::Transaction::HTTP->new); The original handshake transaction, defaults to a Mojo::Transaction::HTTP object. "masked" my $masked = $ws->masked; $ws = $ws->masked(1); Mask outgoing frames with XOR cipher and a random 32bit key. "max_websocket_size" my $size = $ws->max_websocket_size; $ws = $ws->max_websocket_size(1024); Maximum WebSocket message size in bytes, defaults to the value of the "MOJO_MAX_WEBSOCKET_SIZE" environment variable or 262144. METHODS
Mojo::Transaction::WebSocket inherits all methods from Mojo::Transaction and implements the following new ones. "new" my $multi = Mojo::Content::MultiPart->new; Construct a new Mojo::Transaction::WebSocket object and subscribe to "frame" event with default message parser, which also handles "PING" and "CLOSE" frames automatically. "build_frame" my $bytes = $ws->build_frame($fin, $rsv1, $rsv2, $rsv3, $op, $payload); Build WebSocket frame. # Continuation frame with FIN bit and payload say $ws->build_frame(1, 0, 0, 0, 0, 'World!'); # Text frame with payload say $ws->build_frame(0, 0, 0, 0, 1, 'Hello'); # Binary frame with FIN bit and payload say $ws->build_frame(1, 0, 0, 0, 2, 'Hello World!'); # Close frame with FIN bit and without payload say $ws->build_frame(1, 0, 0, 0, 8, ''); # Ping frame with FIN bit and payload say $ws->build_frame(1, 0, 0, 0, 9, 'Test 123'); # Pong frame with FIN bit and payload say $ws->build_frame(1, 0, 0, 0, 10, 'Test 123'); "client_challenge" my $success = $ws->client_challenge; Check WebSocket handshake challenge. "client_handshake" $ws->client_handshake; WebSocket handshake. "client_read" $ws->client_read($data); Read raw WebSocket data. "client_write" my $chunk = $ws->client_write; Raw WebSocket data to write. "connection" my $connection = $ws->connection; Alias for "connection" in Mojo::Transaction. "finish" $ws = $ws->finish; Finish the WebSocket connection gracefully. "is_websocket" my $true = $ws->is_websocket; True. "kept_alive" my $kept_alive = $ws->kept_alive; Alias for "kept_alive" in Mojo::Transaction. "local_address" my $local_address = $ws->local_address; Alias for "local_address" in Mojo::Transaction. "local_port" my $local_port = $ws->local_port; Alias for "local_port" in Mojo::Transaction. "parse_frame" my $frame = $ws->parse_frame($bytes); Parse WebSocket frame. # Parse single frame and remove it from buffer my $frame = $ws->parse_frame($buffer); say "FIN: $frame->[0]"; say "RSV1: $frame->[1]"; say "RSV2: $frame->[2]"; say "RSV3: $frame->[3]"; say "Opcode: $frame->[4]"; say "Payload: $frame->[5]"; "remote_address" my $remote_address = $ws->remote_address; Alias for "remote_address" in Mojo::Transaction. "remote_port" my $remote_port = $ws->remote_port; Alias for "remote_port" in Mojo::Transaction. "req" my $req = $ws->req; Alias for "req" in Mojo::Transaction. "res" my $res = $ws->res; Alias for "res" in Mojo::Transaction. "resume" $ws = $ws->resume; Alias for "resume" in Mojo::Transaction. "send" $ws->send({binary => $bytes}); $ws->send({text => $bytes}); $ws->send([$fin, $rsv1, $rsv2, $rsv3, $op, $payload]); $ws->send('Hi there!'); $ws->send('Hi there!' => sub {...}); Send message or frame non-blocking via WebSocket, the optional drain callback will be invoked once all data has been written. # Send "Ping" frame $ws->send([1, 0, 0, 0, 9, 'Hello World!']); "server_handshake" $ws->server_handshake; WebSocket handshake. "server_read" $ws->server_read($data); Read raw WebSocket data. "server_write" my $chunk = $ws->server_write; Raw WebSocket data to write. DEBUGGING
You can set the "MOJO_WEBSOCKET_DEBUG" environment variable to get some advanced diagnostics information printed to "STDERR". MOJO_WEBSOCKET_DEBUG=1 SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::Transaction::WebSocket(3pm)
All times are GMT -4. The time now is 11:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy