02-13-2009
Multiline replace problem
I have a data of the form
0.0117843924 0. 0. 0. 0.
0.011036017 0. 0. 0. 0.
0.0103351669 0. 0. 0. 0.
4839.41211 0. 0. 0. 0.
4532.08203 0. 0. 0. 0.
I would like to insert a couple of blank lines before the 4839 line, every time it appears. The numbers in the first column follow the same pattern throughout the file, but the next 4 columns may change, so I can't just match the whole line.
Is there a neat way to do this, as I've had no luck with sed.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am a newbie to shell scripting and to Linux environment as well.
In my project I am trying to search for following text from the httpd.conf file
<Directory '/somedir/someinnerdir'>
AllowOverride All
</Directory>
and then remove this text and again rewrite the same text.
The... (1 Reply)
Discussion started by: bhushan
1 Replies
2. Shell Programming and Scripting
I have a sample file like this
7829885 7831552 + 1 1667, 0,
35934936 35937087 - 2 1281,870, 0,1281,
I would like to replace values starts with comma with just value like 0, to 0 or 1667, to 1667.
I can do with this by using tr -d '0,' '0' <file
But the... (2 Replies)
Discussion started by: repinementer
2 Replies
3. UNIX for Advanced & Expert Users
Hi
I have csv file which has test as multiline in the one column. ex.
---------data.csv------------
Seqno,EmpID,EmpName,Dept
1,123,"Vipin
Agrawal","IT
BUSINESS
OFFSHORE"
2,124,"Simon Bhai","IT"
The problem is name "Vipin Agrawal" has one new line character b/w name. same as Dept. ... (1 Reply)
Discussion started by: meetvipin
1 Replies
4. Homework & Coursework Questions
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:
Give the vi command for replacing all occurances of the string "DOS" with the string "UNIX" in the whole... (4 Replies)
Discussion started by: kbreitsprecher
4 Replies
5. Shell Programming and Scripting
Hi there
I just wondered if someone could give me some perl advice
I have a bunch of text files used for a wiki that have common headings such as
---++ Title
blah
---++ Summary
blah
---++ Details
Here is the multiline
block
of text I
wish
to (6 Replies)
Discussion started by: rethink
6 Replies
6. Shell Programming and Scripting
Hi all
I have data files which contain data as shown below:
Line 5: FIDE
INST_DESC: DIAM Co Ltd/Japan => MAID Co Ltd/Japan
INST_NME: DIAM Co Ltd/Japan => MAID Co Ltd/Japan
Line 6: FIDE
INST_DESC: DIAM DL/Pimco US Bond Open Born in the USA => MAID DL/Pimco US Bond Open Born in the... (6 Replies)
Discussion started by: Ganesh_more
6 Replies
7. UNIX for Dummies Questions & Answers
Hi
We have a database export file which needs to be formatted as below
InputCreate view ABC1 as Locking ABC1
for Access select * from PQR
Create view ABC2 as Locking
ABC2 for access
select * from PQR
Create view ABC3
as Locking ABC3
for
Access
select * from PQR
OutputCreate... (5 Replies)
Discussion started by: sheetal.arun
5 Replies
8. Shell Programming and Scripting
I'm trying to replicate the sed output on p.108 of Sed&Awk,by Doughery & Robbins, 2nd edition.
I'm on a Windows 10 Surface Pro, running Cygwin for 64-bit versions of Windows.
Input text saved in text file called data_p108.txt:
Consult Section 3.1 in the Owner and Operator
Guide for a... (9 Replies)
Discussion started by: prooney
9 Replies
9. Shell Programming and Scripting
Hello.
A find command return a list of file.
For each fileReplace the content starting with the first "§" (of two) ending with last "ɸ" (of two), regardless of the content ( five lines )
by the following content (exactly) :
§2019_08_23§ #
# ... (8 Replies)
Discussion started by: jcdole
8 Replies
BWILD(8) Network backup, utilities BWILD(8)
NAME
bwild - Bacula's 'wildcard' engine
SYNOPSIS
bwild [options] -f <data-file>
DESCRIPTION
This manual page documents briefly the bwild command.
This is a simple program that will allow you to test wild-card expressions against a file of data.
OPTIONS
A summary of options is included below.
-? Show version and usage of program.
-d nn Set debug level to nn.
-dt Print timestamp in debug output
-f <data-file>
The data-file is a filename that contains lines of data to be matched (or not) against one or more patterns. When the program is
run, it will prompt you for a wild-card pattern, then apply it one line at a time against the data in the file. Each line that
matches will be printed preceded by its line number. You will then be prompted again for another pattern.
Enter an empty line for a pattern to terminate the program. You can print only lines that do not match by using the -n option, and
you can suppress printing of line numbers with the -l option.
-n Print lines that do not match
-l Suppress lines numbers.
-i use case insensitive match.
SEE ALSO
fnmatch(3)
AUTHOR
This manual page was written by Bruno Friedmann <bruno@ioda-net.ch>.
Kern Sibbald 30 October 2011 BWILD(8)