11-08-2008
Copy or Grep all text below a string
Hello,
I am trying to copy all the text from a file below a search string...
For example i want to grep all text below the word sure:
UNIX for Dummies Questions & Answers
If you're not sure where to post a UNIX or Linux question,
post it here.
All UNIX and Linux newbies welcome !!
Output:
If you're not sure where to post a UNIX or Linux question,
post it here.
All UNIX and Linux newbies welcome !!
Any ideas?
Thanks,
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am wanting to automate a process that includes the step of appending to a filename a string of text that's contained inside the file. I.e. if filename A.fileA contains a string of text that reads 1234 after the phrase ABC, I want the shell script file to rename the file 1234_FileChecked_A.fileA.... (3 Replies)
Discussion started by: HLee1981
3 Replies
2. Shell Programming and Scripting
How to grep a string in two different files,
I am having the following scenario
TextFile1
Date (dd/mm)Time Server IP Error Code
===========================================================================
10/04/2008 10:10 ServerA xxx.xxx.xxx.xxx ... (15 Replies)
Discussion started by: karthikn7974
15 Replies
3. UNIX for Advanced & Expert Users
I am using the following command to email a tex file as an attachment-
cat mailtext.txt | elm -s "Subject" emailAddr
where content of mailtext.txt is -
"Body of email"
This will attach foo.txt with the email.
My problem is that the file foo.txt is ceated dynamically everytime with a... (5 Replies)
Discussion started by: hpuxlxboy
5 Replies
4. Shell Programming and Scripting
Hi! just want to seek help on this:
i have a file wherein i want to find a string and copy the string after that and paste that other string to a new file.
ex:
TOTAL 123456
find "TOTAL" and copy "123456"
and paste "123456" to a new file
NOTE: there are many "TOTAL" strings on that... (12 Replies)
Discussion started by: kingpeejay
12 Replies
5. Shell Programming and Scripting
I have several very large file that are extracts from Oracle tables. These files are formatted in XML type syntax with multiple entries like:
<ROW>
some information
more information
</ROW>
I want to grep for some words, then print all lines between <ROW> AND </ROW>. Can this be done with AWK?... (7 Replies)
Discussion started by: jbruce
7 Replies
6. Shell Programming and Scripting
i have a file1 with many lines. i have a script that will let me input a string. for example, APPLE. what i need to do is to copy all lines from file1 where i can find APPLE or any string that i specify and paste in on file 2
thanks in advance! (4 Replies)
Discussion started by: engr.jay
4 Replies
7. Shell Programming and Scripting
I need to be able to search for a beginning line header, then use grep or something else to get the very next instance of a particular string, which will ALWAYS be in "Line5". What I have is some data that appears like this:
Line1
Line2
Line3
Line4
Line5
Line6
Line7
Line1
Line2
...... (4 Replies)
Discussion started by: Akilleez
4 Replies
8. Shell Programming and Scripting
Hi,
1_strings file contains
$ cat 1_strings
/home/$USER/Src
/home/Valid
/home/Review$ cat myxml
<projected value="some string" path="/home/$USER/Src">
<input 1/>
<estimate value/>
<somestring/>
</projected>
<few more lines >
<projected value="some string" path="/home/$USER/check">... (4 Replies)
Discussion started by: greet_sed
4 Replies
9. Shell Programming and Scripting
I am attempting to grep an exact string from a series of files within a directory and append that output to the filename when it is present in the file. I've been after this all day with no luck. Thanks for your help in advance :wall:. (4 Replies)
Discussion started by: JC_1
4 Replies
10. Shell Programming and Scripting
I have a file that have text like.
Download ABCD Edfdf x8634 4343 554545 (64bit) V33834-01 1.4M
Download ABCD Edfdf x86 (64bit) V33855-01 1.4M
Download ABCD Edfdf x8634 4343 5545 (64bit) V33834-01 1.4M
i want text starts with V*-01 from above file. (2 Replies)
Discussion started by: learnbash
2 Replies
LEARN ABOUT OSX
svk::log::filter::grep
SVK::Log::Filter::Grep(3) User Contributed Perl Documentation SVK::Log::Filter::Grep(3)
SYNOPSIS
SVK::Log::Filter::Grep - search log messages for a given pattern
DESCRIPTION
The Grep filter requires a single Perl pattern (regular expression) as its argument. The pattern is then applied to the svn:log property
of each revision it receives. If the pattern matches, the revision is allowed to continue down the pipeline. If the pattern fails to
match, the pipeline immediately skips to the next revision.
The pattern is applied with the /i modifier (case insensitivity). If you want case-sensitivity or other modifications to the behavior of
your pattern, you must use the "(?imsx-imsx)" extended pattern (see "perldoc perlre" for details). For example, to search for log messages
that match exactly the characters "foo" you might use
svk log --filter "grep (?-i)foo"
However, to search for "foo" without regards for case, one might try
svk log --filter "grep foo"
The result of any capturing parentheses inside the pattern are not available. If demand dictates, the Grep filter could be modified to
place the captured value somewhere in the stash for other filters to access.
If the pattern contains a pipe character ('|'), it must be escaped by preceding it with a '' character. Otherwise, the portion of the
pattern after the pipe character is interpreted as the name of a log filter.
STASH
/PROPERTY MODIFICATIONS
Grep leaves all properties and the stash intact.
perl v5.10.0 2008-08-04 SVK::Log::Filter::Grep(3)