search for a set of characters and move


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting search for a set of characters and move
# 1  
Old 10-20-2011
search for a set of characters and move

I want to search/grep for a set of characters in a file(all occurences) and move them to another file.
Any command line?

regards,
Sri

Last edited by Sriranga; 10-20-2011 at 07:17 AM..
# 2  
Old 10-20-2011
Code:
man grep

# 3  
Old 10-20-2011
thanx jayan_jay! it's the exact command i was looking out for....!!!
keep up ur good suggestions.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to change a set of characters between delimiters?

Hi all, I am trying to write a script for renaming some files and I can't understand how to replace a set of characters between delimiters with sed. The current filename is: <ID1>_<ID2>_<DATE>_<ID3>.PDF And I need to get the following: <ID1>_<ID2>_<DATE>_X01<ID2>.PDF I have tried the... (5 Replies)
Discussion started by: bartleby
5 Replies

2. Shell Programming and Scripting

Help needed with shell script to search and replace a set of strings among the set of files

Hi, I am looking for a shell script which serves the below purpose. Please find below the algorithm for the same and any help on this would be highly appreciated. 1)set of strings need to be replaced among set of files(directory may contain different types of files) 2)It should search for... (10 Replies)
Discussion started by: Amulya
10 Replies

3. Shell Programming and Scripting

move set of files to the target path with different extension

I have the following files in the dir /home/krishna/datatemp abc.xml cde.xml asfd.txt asdf_20120101-1.xml asdf_20120101-2.xml asdf_20120101-3.xml asdf_20120101-4.xml Now I need to move the files having the pattern asdf_20120101-*.xml to the dir /home/krishna/dataout with the extn as... (1 Reply)
Discussion started by: kmanivan82
1 Replies

4. Shell Programming and Scripting

remove the special characters and move the file into another server

(5 Replies)
Discussion started by: number10
5 Replies

5. UNIX for Dummies Questions & Answers

How move characters following a semicolon to a new line

Hello, I was wondering how I can move this: ABC;>12 BLA;>67 DEF;>22 into this ABC >12 BLA >67 DEF >22 thanks for your help. (1 Reply)
Discussion started by: blakers
1 Replies

6. UNIX for Dummies Questions & Answers

move a set of files

Hi Everyone!!! Is there any command to move/copy set of files in a specific range. Eg : I have 800 text files in a directory A1 ... A800 I would like to copy only files in range A40 ... A250. I can acheive this using a "for" loop , but I guess there could be some command or... (8 Replies)
Discussion started by: joey_reddy
8 Replies

7. UNIX for Dummies Questions & Answers

vi search/replace using a set

Hi, I'm trying to do a global search/replace in vi using a set - I want to find every occurance of a carriage return followed by a character and replace it with a space. I've tried the following: :%s/\n/ /g It does the search ok, but it replaces the characters with the literal value ""... (2 Replies)
Discussion started by: HudZo
2 Replies

8. Shell Programming and Scripting

Replacing set of characters with a value of a variable

I need to replace anything immediately after the pattern "standard01/" in a file with the value of a variable I don't know the length of the characters stored in that variable. - that might vary. I know there is some string after the pattern "standard01/", i don't know the what the string is or... (1 Reply)
Discussion started by: prekida
1 Replies

9. Shell Programming and Scripting

how to set a variable to accept alpha-numeric characters?

I am working on a shell program that needs to accept alpha-numeric input (i.e., P00375); when I use a simple 'read' statement to read in the input (i.e., read LOG), I receive the message "p00375: bad number". How must I adjust my input statement to accept alpha-numerics? Thanks! Brent (3 Replies)
Discussion started by: bcaunt
3 Replies
Login or Register to Ask a Question