sed multiple multi line blocks of text containing pattern
Hi,
I have a log file which has sessionids in it, each block in the log starts with a date entry, a block may be a single line or multiple lines. I need to sed (or awk) out the lines/blocks with that start with a date and include the session id.
The files are large at several Gb.
My example file is :
my required output would be :
I am totally unsure how to use the N command to process multiple lines between say regex "^Date.*;sessionid1;" and "^Date" but I think thats the direction I need to be going.
This is my first post, please be nice. I have tried to google and read different tutorials.
The task at hand is:
Input file input.txt (example)
abc123defhij-E-1234jslo
456ujs-W-abXjklp
From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
I have a file with data records separated by multiple equals signs, as below.
==========
RECORD 1
==========
RECORD 2
DATA LINE
==========
RECORD 3
==========
RECORD 4
DATA LINE
==========
RECORD 5
DATA LINE
==========
I need to filter out all data from this file where the... (2 Replies)
Sed replace using same pattern repeating multiple times in a line
I have text like below in a file:
I am trying to replace the above line to following
How can I acheive this?
I am able to do it if the occurrence is for 1 time:
But If I try like below
I am getting like this:
I have to... (4 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I have file which has got the following content
sam 123 LD 41
sam 234 kp
sam LD 41
kam pu
sam LD 61
Now... (1 Reply)
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Dear Unix Forums,
I am hoping you can help me with a pattern matching problem.
What am I trying to do?
I want to replace multiple lines of a text file (that match a multi-line pattern) with a single line of text. These patterns can span several lines and do not always have the same number of... (10 Replies)
I have a line that I need to parse through and extract a pattern that occurs multiple times in it.
Example line:
getInfoCall: info received please proceed, getInfoCall: info received please proceed, getInfoCall: info received please proceed, getInfoCall: info received please proceed,... (4 Replies)
Here is the text that I was to run sed on. In this text I want to insert a semi colon ';' before 'select a13.STORE_TYPE STORE_TYPE,' and after 'from ZZMR00 pa11'
Input text:
insert into ZZMQ01
select pa11.STATE_NBR STATE_NBR,
pa11.STORE_TYPE STORE_TYPE,
... (9 Replies)
Looking for help,
i have input file like below and want to modify to expected output, if can without create additional file, hope can direct modify it.
have 2 thing need do.
1st
is adding a word (testplan generation off) after ! ! IPG: Tue Aug 07 14:31:17 2018
2nd
is adding... (16 Replies)
Discussion started by: kttan
16 Replies
LEARN ABOUT DEBIAN
padre::constant
Padre::Constant(3pm) User Contributed Perl Documentation Padre::Constant(3pm)NAME
Padre::Constant - constants used by configuration subsystems
SYNOPSIS
use Padre::Constant ();
[...]
# do stuff with exported constants
DESCRIPTION
Padre uses various configuration subsystems (see "Padre::Config" for more information). Those systems needs to somehow agree on some basic
stuff, which is defined in this module.
CONSTANTS
"WIN32", "MAC", "UNIX"
Operating Systems.
"BOOLEAN", "POSINT", "INTEGER", "ASCII", "PATH"
Settings data types (based on Firefox types).
"HOST", "HUMAN", "PROJECT"
Settings storage back-ends.
"PADRE_REVISION"
The SVN Revision (when running a development build).
"PADRE_BLACK", "PADRE_BLUE", "PADRE_RED", "PADRE_GREEN", "PADRE_MAGENTA", "PADRE_ORANGE", "PADRE_DIM_GRAY", "PADRE_CRIMSON", "PADRE_BROWN",
"PADRE_WARNING", "PADRE_ERROR"
Core supported colours.
"CONFIG_HOST"
DB configuration file storing host settings.
"CONFIG_HUMAN"
YAML configuration file storing user settings.
"CONFIG_DIR"
Private Padre configuration directory Padre, used to store stuff.
"PLUGIN_DIR"
Private directory where Padre can look for plug-ins.
"PLUGIN_LIB"
Subdirectory of "PLUGIN_DIR" with the path "Padre/Plugin" added (or whatever depending on your platform) so that Perl can load a
"Padre::Plugin::" plug-in.
"LOG_FILE"
Path and name of Padre's log file.
"NEWLINE"
Newline style (UNIX, WIN or MAC) on the currently used operating system.
COPYRIGHT & LICENSE
Copyright 2008 - 2010 The Padre development team as listed in Padre.pm.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.
perl v5.14.2 2012-06-27 Padre::Constant(3pm)