05-16-2012
Use awk.
You can reassign the "RS" special variable, which separates records and is a newline per default, to some arbitrary value - in your case the several equal signs.
I hope this helps.
bakunin
/Edit: neutronscott beat me to it.
This User Gave Thanks to bakunin For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Guys,
I am new to awk and sed, i am working multiline document, i want to make make that document into SINGLE lines based on occurace of string "dwh".
here's the sample of my problem..
dwh123 2563 4562 4236 1236 78956 12394 4552 dwh192 2656 46536 231326 65652 6565 23262 16625623... (5 Replies)
Discussion started by: victor369
5 Replies
2. Shell Programming and Scripting
Hello
I need to search for a mult-line strngs(with spaces in between and qoted) in a file1 and replace that text with Fixed string globally in file1. The strng to search for is in file2.
The file is big with some 20K records. so speed and effciency is required
file1: (where srch & rplc will... (7 Replies)
Discussion started by: Hiano
7 Replies
3. Shell Programming and Scripting
Hi,
I have a file with text like this
.SET WIDTH 10000
.SET MAXERROR 1
insert into new_db
SELECT
*
FROM
some_db
;
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
.SET WIDTH 10000... (3 Replies)
Discussion started by: sol_nov
3 Replies
4. Shell Programming and Scripting
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... (3 Replies)
Discussion started by: andyatit
3 Replies
5. Shell Programming and Scripting
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)
Discussion started by: thefang
10 Replies
6. Shell Programming and Scripting
Hi
I have some data in a file as below
******************************
Class 1A
Students absent are :
1. ABC
2. CDE
3. CPE
******************************
Class 2A
Students absent are :
******************************
Class 3A
Students absent are : (6 Replies)
Discussion started by: reldb
6 Replies
7. Shell Programming and Scripting
I've a file like this
{multi line
.......
.......
pattern}
{
some other stuff
.........
}
{multi line
.......
.......
pattern}
{
some other stuff
.........
}
and so on (2 Replies)
Discussion started by: aamir_raihan
2 Replies
8. Shell Programming and Scripting
Input File:
>Seq1
ASDADAFASFASFADGSDGFSDFSDFSDFSDFSDFSDFSDFSDFSDFSDFSD
>Seq2
SDASDAQEQWEQeqAdfaasd
>Seq3
ASDSALGHIUDFJANCAGPATHLACJHPAUTYNJKG
......
Desired Output File
>Seq1
ASDADAFASF
ASFADGSDGF
SDFSDFSDFS
DFSDFSDFSD
FSDFSDFSDF
SD
>Seq2 (4 Replies)
Discussion started by: patrick87
4 Replies
9. Shell Programming and Scripting
I want to read the log file which was generate from other command . And the output was having multi line in log files for job name and server name. But i need to make all the logs on one line
Source file
07/15/2018 17:02:00 TRANSLOG_1700 Server0005_SQL ... (2 Replies)
Discussion started by: ranjancom2000
2 Replies
10. UNIX for Beginners Questions & Answers
The following is a multi-line shell command example:
$cargo build
Compiling prawn v0.1.0 (/Users/ag/rust/prawn)
error: failed to resolve: could not find `setup_panix` in `human_panic`
--> src/main.rs:14:22
|
14 | human_panic::setup_panix!();
| ... (2 Replies)
Discussion started by: yogi
2 Replies
LEARN ABOUT DEBIAN
perf_3.2-record
PERF_3.2-RECORD(1) perf Manual PERF_3.2-RECORD(1)
NAME
perf-record - Run a command and record its profile into perf.data
SYNOPSIS
perf record [-e <EVENT> | --event=EVENT] [-l] [-a] <command>
perf record [-e <EVENT> | --event=EVENT] [-l] [-a] -- <command> [<options>]
DESCRIPTION
This command runs a command and gathers a performance counter profile from it, into perf.data - without displaying anything.
This file can then be inspected later on, using perf report.
OPTIONS
<command>...
Any command you can specify in a shell.
-e, --event=
Select the PMU event. Selection can be:
o a symbolic event name (use perf list to list all events)
o a raw PMU event (eventsel+umask) in the form of rNNN where NNN is a hexadecimal event descriptor.
o a hardware breakpoint event in the form of mem:addr[:access] where addr is the address in memory you want to break in. Access is
the memory access type (read, write, execute) it can be passed as follows: mem:addr[:[r][w][x]]. If you want to profile read-write
accesses in 0x1000, just set mem:0x1000:rw.
--filter=<filter>
Event filter.
-a, --all-cpus
System-wide collection from all CPUs.
-l
Scale counter values.
-p, --pid=
Record events on existing process ID.
-t, --tid=
Record events on existing thread ID.
-r, --realtime=
Collect data with this RT SCHED_FIFO priority.
-D, --no-delay
Collect data without buffering.
-A, --append
Append to the output file to do incremental profiling.
-f, --force
Overwrite existing data file. (deprecated)
-c, --count=
Event period to sample.
-o, --output=
Output file name.
-i, --no-inherit
Child tasks do not inherit counters.
-F, --freq=
Profile at this frequency.
-m, --mmap-pages=
Number of mmap data pages.
-g, --call-graph
Do call-graph (stack chain/backtrace) recording.
-q, --quiet
Don't print any message, useful for scripting.
-v, --verbose
Be more verbose (show counter open errors, etc).
-s, --stat
Per thread counts.
-d, --data
Sample addresses.
-T, --timestamp
Sample timestamps. Use it with perf report -D to see the timestamps, for instance.
-n, --no-samples
Don't sample.
-R, --raw-samples
Collect raw sample records from all opened counters (default for tracepoint counters).
-C, --cpu
Collect samples only on the list of CPUs provided. Multiple CPUs can be provided as a comma-separated list with no space: 0,1. Ranges
of CPUs are specified with -: 0-2. In per-thread mode with inheritance mode on (default), samples are captured only when the thread
executes on the designated CPUs. Default is to monitor all CPUs.
-N, --no-buildid-cache
Do not update the builid cache. This saves some overhead in situations where the information in the perf.data file (which includes
buildids) is sufficient.
-G name,..., --cgroup name,...
monitor only in the container (cgroup) called "name". This option is available only in per-cpu mode. The cgroup filesystem must be
mounted. All threads belonging to container "name" are monitored when they run on the monitored CPUs. Multiple cgroups can be provided.
Each cgroup is applied to the corresponding event, i.e., first cgroup to first event, second cgroup to second event and so on. It is
possible to provide an empty cgroup (monitor all the time) using, e.g., -G foo,,bar. Cgroups must have corresponding events, i.e., they
always refer to events defined earlier on the command line.
SEE ALSO
perf_3.2-stat(1), perf_3.2-list(1)
perf 06/24/2012 PERF_3.2-RECORD(1)