any savant ? using AWK/SED to remove newline character between two strings : conditional removal
I'd like to remove (do a pattern or precise replacement - this I can handle in SED using Regex )
---AFTER THE 1ST Occurrence ( i.e. on the 2nd occurrence - from the 2nd to fourth occurance ) of a specific string : type 1
-- After the 1st occurrence of 1 string1 till the 1st occurrence of string2 not counting the latter.
e.g.
/* Notice How I made the above English incoherent by putting newline breaking words, those newline need to go */
End Transaction ;
- How do I go about knocking of the newline char between Last Begin and End transaction pair
Program Thought : Go find the 3rd Begin transaction statement and knock off the newline until the 1st end transaction statement
Moderator's Comments:
Please use [code] and [/code] tags when posting code, data or logs etc. to preserve formatting and enhance readability, thanks.
Last edited by zaxxon; 03-02-2011 at 03:50 AM..
Reason: code tags
I have a script that produces an output containing '/.ssh'.
I am trying to find a way of parsing only this data from a single line, without removing any other special characters contained within the output as a result of the parse.
Any help would be appreciated (6 Replies)
Hi,
I have input file contains sql queries i need to eliminate newlines from it.
when i open it vi text editor and runs
:%s/'\n/'/g
it provides required result. but when i run sed command from shell prompt it doesn't impact outfile is still same as inputfile.
shell] sed -e... (6 Replies)
Hello
I've got a string of text with a number in pence, e.g. 0.52p, I need to remove the 'p' so that it just reads 0.52 without of course removing all the other 'p' characters.
Many thanks (1 Reply)
hi i am having delimited .dat file having content like below.
test.dat(5 line of records)
======
PT2~Stag~Pt2 Stag Test.
Updated~PT2 S T~Area~~UNCEF R20~~2012-05-24 ~2014-05-24~~
PT2~Stag y~Pt2 Stag Test.
Updated~PT2 S T~Area~METR~~~2012-05-24~2014-05-24~~test
PT2~Pt2 Stag Test~~PT2 S... (4 Replies)
Below am trying to separate FA-7A:1, In output file it should display 7A 1
Command am using
Gives same output as below format:
22B7 10000000c9720873 0
22B7 10000000c95d5d8b 0
22BB 10000000c97843a2 0
22BB 10000000c975adbd 0
Not showing FA ports as required format... (5 Replies)
Below i am trying to remove "/" and "r" from the output, so i need output as:
hdiskpower3
hdisk0
hdisk1
#inq | grep 5773 | awk '{print $1}' | sed 's/dev//g' | awk -F"/" '{$1=$1}1'
.....................................................//rhdiskpower0
//rhdiskpower1
//rhdiskpower2... (3 Replies)
Hi all..
I have a text file which looks like below:
abcd
efgh
ijkl
(blank space)
I need to remove only the last (blank space) from the file. When I try wc -l the file name,the number of lines coming is 3 only, however blank space is there in the file.
I have tried options like... (14 Replies)
Here is my task, I feel sure this can be accomplished with see/awk but can't seem to figure out how.
I have large flat file from which I need to extract every case of a pairing of characters (GG) in this case PLUS the previous 20 characters. The output should be a list (which I plan to make... (17 Replies)
Hi all,
I need to remove DBPATH= and /db from the string below using awk (or sed, as it also exists on the machine).
Input: DBPATH=/some/path/database/db
Desired output: /some/path/database
Thank you! (8 Replies)
I have a file which comes every day and the file data look's as below.
Vi abc.txt
a|b|c|d\n
a|g|h|j\n
Some times we receive the file with only a new line character in the file like
vi abc.txt
\n (8 Replies)
Discussion started by: rak Kundra
8 Replies
LEARN ABOUT DEBIAN
kiokudb::backend::role::txn
KiokuDB::Backend::Role::TXN(3pm) User Contributed Perl Documentation KiokuDB::Backend::Role::TXN(3pm)NAME
KiokuDB::Backend::Role::TXN - Backend level transaction support.
SYNOPSIS
package MyBackend;
use Moose;
with qw(
KiokuDB::Backend
KiokuDB::Backend::Role::TXN
);
sub txn_begin { ... }
sub txn_commit { ... }
sub txn_rollback { ... }
DESCRIPTION
This API is inspired by standard database transactions much like you get with DBI.
This is the low level interface required by "txn_do" in KiokuDB.
OPTIONAL METHODS
txn_do $code, %callbacks
This method should evaluate the code reference in the context of a transaction, inside an "eval". If any errors are caught the
transaction should be aborted, otherwise it should be committed. This is much like "txn_do" in DBIx::Class::Schema.
The "rollback" callback should be fired when the transaction will be aborted.
REQUIRED METHODS
txn_begin [ $parent_txn ]
Begin a new transaction.
This method can return a transaction handle that will later be passed to "txn_commit" or "txn_rollback" as necessary.
The current handle will be passed to nested calls to "txn_begin".
txn_commit $txn
Commit the transaction.
txn_rollback $txn
Rollback the transaction.
perl v5.12.4 2010-10-11 KiokuDB::Backend::Role::TXN(3pm)