Sponsored Content
Top Forums Shell Programming and Scripting Search and remove in a text file Post 302383226 by nogame11 on Monday 28th of December 2009 11:56:32 PM
Old 12-29-2009
Search and remove in a text file

Need help whit a script where I have to input a name and then remove a line where that name is in a file

file ex:
001op;Name;Location;date
002op;Name;Location;date

and so on....

can anybody help me???

thanks

Last edited by Yogesh Sawant; 12-31-2009 at 01:52 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove specified text from file

I am trying to write a script that kills old sessions, I've posted here over the past few days and the script is just about perfect except I want to be given the option to exclude specified PIDs from being killed. this is the entire script: if then rm /tmp/idlepids fi if then rm... (2 Replies)
Discussion started by: raidzero
2 Replies

2. UNIX for Dummies Questions & Answers

search and replace a specific text in text file?

I have a text file with following content (3 lines) filename : output.txt first line:12/12/2008 second line:12/12/2008 third line:Y I would like to know how we can replace 'Y' with 'N' in the 3rd line keeping 1st and 2nd lines same as what it was before. I tried using cat output.txt... (4 Replies)
Discussion started by: santosham
4 Replies

3. Shell Programming and Scripting

Search text from a file and print text and one previous line too

Hi, Please let me know how to find text and print text and its previous line. Please don't get irritated few days back I asked text and next line. I am using HP-UX 11.11 Thanks for your help. (6 Replies)
Discussion started by: kamranjalal
6 Replies

4. Shell Programming and Scripting

Search and Remove Lines within File

Hello, I've searched through the scripting section but could not find what I need. I need to search for empty sections within a file and remove them. Here is an example file: Title 123 A B C D E Title 098 Title 567 Z Y (4 Replies)
Discussion started by: leepet01
4 Replies

5. Shell Programming and Scripting

Search based on 1,2,4,5 columns and remove duplicates in the same file.

Hi, I am unable to search the duplicates in a file based on the 1st,2nd,4th,5th columns in a file and also remove the duplicates in the same file. Source filename: Filename.csv "1","ccc","information","5000","temp","concept","new" "1","ddd","information","6000","temp","concept","new"... (2 Replies)
Discussion started by: onesuri
2 Replies

6. Shell Programming and Scripting

search text file in file if this file contains necessary text (awk,grep)

Hello friends! Help me pls to write correct awk and grep statements for my task: I have got files with name filename.txt It has such structure: Start of file FROM: address@domen.com (12...890) abc DATE: 11/23/2009 on Std SUBJECT: any subject End of file So, I must check, if this file... (4 Replies)
Discussion started by: candyme
4 Replies

7. Shell Programming and Scripting

How to search multiple patterns and remove lines from a file?

Hi, I have a file content as below. Table : PAYR Displayed fields: 15 of 15 Fixed columns: 4 List width 0999... (4 Replies)
Discussion started by: shirdi
4 Replies

8. Shell Programming and Scripting

Read in search strings from text file, search for string in second text file and output to CSV

Hi guys, I have a text file named file1.txt that is formatted like this: 001 , ID , 20000 002 , Name , Brandon 003 , Phone_Number , 616-234-1999 004 , SSNumber , 234-23-234 005 , Model , Toyota 007 , Engine ,V8 008 , GPS , OFF and I have file2.txt formatted like this: ... (2 Replies)
Discussion started by: An0mander
2 Replies

9. Shell Programming and Scripting

Search a text and return the text from file

Hi I have a set of input strings in a pattern as given below string1 string2 string3 string4 string5 I need to search this sequence of strings from a file in such a way that the first two strings (string1 and string2) and last two strings (string4 and string5) should match with the... (8 Replies)
Discussion started by: my_Perl
8 Replies

10. Shell Programming and Scripting

How to remove the text between all curly brackets from text file?

Hello experts, I have a text file with lot of curly brackets (both opening { & closing } ). I need to delete them alongwith the text between opening & closing brackets' pair. For ex: Input:- 59. Rh1 Qe4 {(Qf5-e4 Qd8-g8+ Kg6-f5 Qg8-h7+ Kf5-e5 Qh7-e7+ Ke5-f5 Qe7-d7+ Qe4-e6 Qd7-h7+ Qe6-g6... (6 Replies)
Discussion started by: prvnrk
6 Replies
lb_unregister(3ncs)													       lb_unregister(3ncs)

Name
       lb_unregister - remove an entry from the Location Broker database

Syntax
       #include <idl/c/lb.h>

       void lb_$unregister(entry, status)
       lb_$entry_t *entry;
       status_$t *status;

Arguments
       entry  The entry being removed from the Location Broker database.

       status The completion status.  If the completion status returned in is equal to status_$ok , then the routine that supplied it was success-
	      ful.

Description
       The routine removes from the Location Broker database the entry that matches entry.  The  value	of  entry  should  be  identical  to  that
       returned  by  the routine when the database entry was created.  However, does not compare all of the fields in entry, the annotation field,
       and the port number in the saddr field.

       This routine removes the entry from the LLB database on the local host (the host that issues the routine).  If the flags field of entry	is
       equal  to  0,  it  removes  the entry from the GLB database.  If the flags field is equal to lb_$server_flag_local, it deletes only the LLB
       entry.

Examples
       The following statement unregisters the entry specified by which was obtained from a previous routine:
       lb_$unregister (&BankEntry, &status);

Diagnostics
       This section lists status codes for errors returned by this routine in

       lb_$database_invalid
			   The format of the Location Broker database is out of date.  The database may have been created by an old version of the
			   Location  Broker;  in this case, delete the out-of-date database and reregister any entries that it contained.  The LLB
			   or GLB that was accessed may be running out-of-date software; in this case, update all Location Brokers to the  current
			   software version.

       lb_$database_busy   The Location Broker database is currently in use in an incompatible manner.

       lb_$not_registered  The	Location  Broker  does	not  have  any	entries  that match the criteria specified in the unregister routine.  The
			   requested object, type, interface, or combination thereof is not registered in the specified database.

       lb_$update_failed   The Location Broker was unable to register or unregister the entry.

       lb_$cant_access	   The Location Broker cannot access the database.  Among the possible reasons:

			   1. The database does not exist.

			   2. The database exists, but the Location Broker cannot access it.

       lb_$server_unavailable
			   The Location Broker Client Agent cannot reach the requested GLB or LLB.  A communications failure occurred or the  bro-
			   ker was not running.

Files
See Also
       intro(3ncs), lb_register(3ncs)

															       lb_unregister(3ncs)
All times are GMT -4. The time now is 07:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy