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_lookup_interface(3ncs)												 lb_lookup_interface(3ncs)

Name
       lb_lookup_interface - look up information about an interface in the Global Location Broker database

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

       void lb_$lookup_interface(obj_interface, lookup_handle, max_num_results, 			      num_results, results, status)
       uuid_$t *obj_interface;
       lb_$lookup_handle_t *lookup_handle;
       unsigned long max_num_results;
       unsigned long * num_results;
       lb_$entry_t results[ ];
       status_$t *status;

Arguments
       obj_interface	   The UUID of the interface being looked up.

       lookup_handle	   A  location	in  the  database.   On  input,  the lookup_handle indicates the location in the database where the search
			   begins.  An input value of lb_$default_lookup_handle specifies that the search will start at the beginning of the data-
			   base.  On return, the lookup_handle indicates the next unsearched part of the database (that is, the point at which the
			   next search should begin).  A return value of lb_$default_lookup_handle indicates that the search reached  the  end	of
			   the database; any other return value indicates that the search found at most max_num_results matching entries before it
			   reached the end of the database.

       max_num_results	   The maximum number of entries that can be returned by a single routine.  This should be the number of elements  in  the
			   results array.

       num_results	   The number of entries that were returned in the results array.

       results		   An  array that contains the matching GLB database entries, up to the number specified by the max_num_results parameter.
			   If the array contains any entries for servers on the local network, those entries appear first.

       status		   The completion status.

Description
       The routine returns GLB database entries whose obj_interface fields match the specified interface.  It returns  information  about  objects
       that can be accessed through that interface.

       The routine cannot return more than max_num_results matching entries at a time.	The lookup_handle parameter enables you to find all match-
       ing entries by doing sequential lookups.

       If you use a sequence of lookup routines to find entries in the database, it is possible that the returned results will skip  or  duplicate
       entries.   This	is  because  the  Location Broker does not prevent modification of the database between lookups, and such modification can
       change the locations of entries relative to a lookup_handle value.

       It is also possible that the results of a single lookup routine will skip or duplicate entries.	This can occur if the size of the  results
       exceeds the size of an RPC packet (64K bytes).

Examples
       The following statement looks up information in the GLB database about a matrix multiplication interface:
       lb_$lookup_interface (&matrix_id, &lookup_handle, max_results,
			       &num_results, &matrix_results, &st);

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

       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 lookup  or  unregister  routine.
			   The	requested object, type, interface, or combination thereof is not registered in the specified database.	If you are
			   using an or routine specifying an LLB, check that you have specified the correct LLB.

       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_lookup_object(3ncs), lb_lookup_range(3ncs), lb_lookup_type(3ncs)

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