Remove a non-specific word froma file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Remove a non-specific word froma file
# 1  
Old 05-12-2009
Remove a non-specific word froma file

Hi All,

I am encountering a problem while removing a string from a file. Actually, i have done this thing before using sed to replace the word but this time word is not specfic. its value is changing with each file.

e.g.
%HD% Serial Number list per DN required. +3 -0 sked://BaxBiztalk!XLANG Scheduler/{2FF54557-143A-4B0C-BD19-535BC3DE94C3} Y 20090202T141927.000Z N N 1 0000538236 YUR,2ND MAIN RD TRUSTPURAM, KODAMBAKKAM, CHENNAI - 600 024

I need to remove the word "sked://BaxBiztalk!XLANG Scheduler/{2FF54557-143A-4B0C-BD19-535BC3DE94C3}" from a number of files. The part of the word inside {} is varying with the file.So it is difficult to remove it using sed.

So please help me to get a solution.

Thanks
Neeraj
# 2  
Old 05-12-2009
Code:
 
sed 's/\(.*\)\(sked.*\}\)\( Y.*\)/\1\3/' input_filename.txt

will do the job.
# 3  
Old 05-13-2009
Thanks Buddy.....your solution worked just after one modification ....

I changed it to: sed 's/(sked.*\)\( Y.*\)/\2/' input_filename.txt

Thanks a lot...

Neeraj
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search for a specific word and print only the word from the input file

Hi, I have a sample file as shown below, I am looking for sed or any command which prints the complete word only from the input file. Ex: $ cat "sample.log" I am searching for a word which is present in this file We can do a pattern search using grep but I need to cut only the word which... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies

2. UNIX for Dummies Questions & Answers

Quick UNIX command to display specific lines in the middle of a file from/to specific word

This could be a really dummy question. I have a log text file. What unix command to extract line from specific string to another specific string. Is it something similar to?: more +/"string" file_name Thanks (4 Replies)
Discussion started by: aku
4 Replies

3. UNIX for Dummies Questions & Answers

How to remove JUNK characters (FROM�)

Hi I have to remove the junk characters from my file. Please help.. File content : CURITY_CODE_GSD) FROM� DL_CB_SOD_EOD_VALUATION WHERE� ASOF (1 Reply)
Discussion started by: arukuku
1 Replies

4. UNIX for Dummies Questions & Answers

How to print the specific word in a file.

Hi , My input file is below like that :- $cat abc.txt Service name: test_taf Service is enabled Server pool: test_tac Cardinality: 2 Disconnect: false Service role: PRIMARY Management policy: AUTOMATIC DTP transaction: false AQ HA notifications: true Failover type: SESSION... (3 Replies)
Discussion started by: sp001
3 Replies

5. UNIX for Dummies Questions & Answers

How to print line starts with specific word and contains specific word using sed?

Hi, I have gone through may posts and dint find exact solution for my requirement. I have file which consists below data and same file have lot of other data. <MAPPING DESCRIPTION ='' ISVALID ='YES' NAME='m_TASK_UPDATE' OBJECTVERSION ='1'> <MAPPING DESCRIPTION ='' ISVALID ='NO'... (11 Replies)
Discussion started by: tmalik79
11 Replies

6. Shell Programming and Scripting

Check a specific word whether is in file

I want to valid a specific word whether it is contained in the text file. For example: family.txt father mother son sister if ("father" contain in family.txt) do some process else do other process How shell scripting can accomplish this? Anyone can provide helps? (3 Replies)
Discussion started by: alvin0618
3 Replies

7. UNIX for Dummies Questions & Answers

Search a specific word from any one of the file.

how do i Search a specific word from any one of the file.? (1 Reply)
Discussion started by: ritusubash
1 Replies

8. Shell Programming and Scripting

Remove specific word from data contents problem asking

Hi, Below is my input file: >tempZ_1 SAFSDAFDSG GGERRTTZZZ ZASRARARET WETPOASDAZ ZZZASASFAS >temp_9 ASAEGPIOEO EIOPIZZZAS FDFGZZZARA ESEAZZZAAS . . Desired output file: (9 Replies)
Discussion started by: patrick87
9 Replies

9. Shell Programming and Scripting

Remove particular word from file

Hi All, If my file is: Wed Sep 9 22:45:14 EDT 2009 sftp> sftp> sftp> sftp> sftp> sftp> sftp> sftp> sftp> sftp> sftp> sftp> sftp> This is log file generated from transfer... sftp> sftp> sftp> sftp> Files placed properly.... sftp> sftp> sftp> How can I remove "sftp>" word from this... (4 Replies)
Discussion started by: darshakraut
4 Replies

10. Shell Programming and Scripting

To search a file for a specific word in a file using shell script

Hi All, I have a sql output file has below. I want to get the values 200000040 and 1055.49 .Can anyone help me to write a shell script to get this. ACCOUNT_NO ------------------------------------------------------------ BILL_NO ... (8 Replies)
Discussion started by: girish.raos
8 Replies
Login or Register to Ask a Question