Sponsored Content
Full Discussion: Search and paste a line..
Top Forums UNIX for Dummies Questions & Answers Search and paste a line.. Post 74082 by SeanDM on Tuesday 7th of June 2005 04:06:03 PM
Old 06-07-2005
Search for a keyword in a line then output the line

Hi everyone, I've never used Unix ever in my life and I just got a summer job that requires me to manipulate Unix =(

I'm currently encountering a problem...
I need to search for Keyword in a text file, and if I find Keyword , I'll have to output the whole line that contains Keyword into a new text file. I know it can be done with a If-then statement...but I don't know the syntax, could someone please help me? Thanks!

Last edited by SeanDM; 06-07-2005 at 05:12 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

copy and paste a specific line

Hi I am having some trouble cut and paste a file based on the content of another file. I have a file called draft. I need to cut and paste its content to another file based on the content of a file called proc.txt The content of proc.txt is like the following:... (7 Replies)
Discussion started by: tiger99
7 Replies

2. Shell Programming and Scripting

Search, copy and paste

Can i search in a file for more than one string at a time? And copy the next string after that and paste it in column style? Is it possible? Thanks! (4 Replies)
Discussion started by: kingpeejay
4 Replies

3. Shell Programming and Scripting

Vi Editor - How to paste the line concatenated with current line

I generally use yy to copy a line and then p to paste the line at end of current line. But is there a way to paste the copied line in concatenation with the current line with out going to next line. (3 Replies)
Discussion started by: paragkalra
3 Replies

4. Shell Programming and Scripting

perl search and replace - search in first line and replance in 2nd line

Dear All, i want to search particular string and want to replance next line value. following is the test file. search string is tmp,??? ,10:1 "???" may contain any 3 character it should remain the same and next line replace with ,10:50 tmp,123 --- if match tmp,??? then... (3 Replies)
Discussion started by: arvindng
3 Replies

5. Shell Programming and Scripting

sed help - search/copy from one file and search/paste to another

I am a newbie and would like some help with the following - Trying to search fileA for a string similar to - AS11000022010 30.4 31.7 43.7 53.8 60.5 71.1 75.2 74.7 66.9 56.6 42.7 32.5 53.3 I then want to replace that string with a string from fileB - ... (5 Replies)
Discussion started by: ncwxpanther
5 Replies

6. Shell Programming and Scripting

Can't paste in command line.

Hello. I've made a simple script which asks the user to input a hash and then runs a command that replaces the variable $hash with what the user inserted. The ting is that when the programm asks for input I can't paste anything there..! any clues?? :wall: (8 Replies)
Discussion started by: louboulos
8 Replies

7. Shell Programming and Scripting

Paste every other line?

Hi! I have two files that look like this: File1 A B C D E F ... File2 Z Y X W V U (4 Replies)
Discussion started by: Limmnes
4 Replies

8. UNIX for Dummies Questions & Answers

vim copy line and paste at the beginning, middle, and end of another line

How would you do vim copy line and paste at the beginning, middle, and end of another line. I know yy copies the whole line and p pastes the whole line, but on its own separate line. Sometimes I would like to copy a line to the beginning, middle, or end of another line. I would think this would be... (3 Replies)
Discussion started by: cokedude
3 Replies

9. Shell Programming and Scripting

Copy some line and paste it after some line in same file

Hi, I want to know how I can copy line 6th to 10th and paste it after 17th line in same file. Thanks, Biplab (19 Replies)
Discussion started by: Biplab
19 Replies

10. Programming

Writing a search, copy and paste program

Hello, Can some one help me by writing me the script of a program that does the following simple functions on a Linux Mint: 1. it runs in the background all the time, doing nothing except of checking if there is any external device mounted. 2. when the device is detected, it copies files... (1 Reply)
Discussion started by: Black_Ardilla
1 Replies
MooseX::Declare::Syntax::Keyword::MethodModifier(3pm)	User Contributed Perl Documentation  MooseX::Declare::Syntax::Keyword::MethodModifier(3pm)

NAME
MooseX::Declare::Syntax::Keyword::MethodModifier - Handle method modifier declarations DESCRIPTION
Allows the implementation of method modification handlers like "around" and "before". ATTRIBUTES
modifier_type A required string that is one of: o around o after o before o override o augment METHODS
register_method_declaration Object->register_method_declaration (Object $metaclass, Str $name, Object $method) This will add the method modifier to the $metaclass via Moose::Utils "add_method_modifier", whose return value will also be returned from this method. CONSUMES
o MooseX::Declare::Syntax::MethodDeclaration SEE ALSO
o MooseX::Declare o MooseX::Declare::Syntax::MooseSetup o MooseX::Declare::Syntax::MethodDeclaration o MooseX::Method::Signatures AUTHOR
Florian Ragwitz <rafl@debian.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2008 by Florian Ragwitz. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.18.2 2013-12-14 MooseX::Declare::Syntax::Keyword::MethodModifier(3pm)
All times are GMT -4. The time now is 11:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy