Sponsored Content
Top Forums Shell Programming and Scripting search and delete the lines in a file Post 302627723 by pmreddy on Saturday 21st of April 2012 01:27:45 PM
Old 04-21-2012
search and delete the lines in a file

HI group members


I am new in unix

I want to search # symbol in a file.
if found need to delete the entire row in the file.
need to move the actual data(with out # symbol data) to another file.

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search 2 lines and delete above line

Hi, I've been searching in this forum for the last 4 hours trying to do one thing: search 2 lines and delete the above line. So far I have not be able to find something similar in this forum, so I need help. This is what I'm trying to do. For example, I have a file called file1: file1 word1... (4 Replies)
Discussion started by: shamushamu
4 Replies

2. Shell Programming and Scripting

search a word and delete consecutive lines below it

Hi all coders, I need a help to process some data. I have this file, 3 09/21/08 03:32:07 started undef mino Oracle nmx004.wwdc.numonyx.co m Message Text : The Oracle session with the PID 1103 has a CPU time consuming of 999.00... (3 Replies)
Discussion started by: vikas027
3 Replies

3. Shell Programming and Scripting

search for keyword in subsequent lines and delete the second line

I have my data something like this I need to search for the keyword yyyy in the susequent lines and if it is present, delete the second line with keyword. In other words, if a keywords is found in two subsequent lines delete the second line. input data: aaaa bbbbb cccc dddd xxxx... (4 Replies)
Discussion started by: rdhanek
4 Replies

4. Shell Programming and Scripting

Delete new lines based on search criteria

Hi all! A bit of background: I am trying to create a script that formats SQL statements. I have gotten so far as to add new lines based on certain match criteria like commas, keywords etc. In the process, I end up adding newlines where I don't want. For example: substr(colName, 1, 10)... (3 Replies)
Discussion started by: jayarkay
3 Replies

5. UNIX for Advanced & Expert Users

In a huge file, Delete duplicate lines leaving unique lines

Hi All, I have a very huge file (4GB) which has duplicate lines. I want to delete duplicate lines leaving unique lines. Sort, uniq, awk '!x++' are not working as its running out of buffer space. I dont know if this works : I want to read each line of the File in a For Loop, and want to... (16 Replies)
Discussion started by: krishnix
16 Replies

6. Shell Programming and Scripting

search and replace, when found, delete multiple lines, add new set of lines?

hey guys, I tried searching but most 'search and replace' questions are related to one liners. Say I have a file to be replaced that has the following: $ cat testing.txt TESTING AAA BBB CCC DDD EEE FFF GGG HHH ENDTESTING This is the input file: (3 Replies)
Discussion started by: DeuceLee
3 Replies

7. Shell Programming and Scripting

sed search pattern and delete lines

Hello, i have a question. My problem is that i have a file like: TEST JOHN ADAM MICHAEL SEBASTIAN ANDY i want find for MICHAEL and want delete lines like this: TEST (4 Replies)
Discussion started by: eightball
4 Replies

8. Shell Programming and Scripting

Need To Delete Lines Based On Search Criteria

Hi All, I have following input file. I wish to retain those lines which match multiple search criteria. The search criteria is stored in a variable seperated from each other by comma(,). SEARCH_CRITERIA = "REJECT, DUPLICATE" Input File: ERROR,MYFILE_20130214_11387,9,37.75... (3 Replies)
Discussion started by: angshuman
3 Replies

9. Shell Programming and Scripting

Search 2 days older file and then delete last 10 lines

I want to search 2 day older file and then delete last 10 line of that file. (2 Replies)
Discussion started by: sonu pandey
2 Replies

10. UNIX for Beginners Questions & Answers

How to search & delete inclusively between two lines?

Hi all, I was wondering if anyone would know how to search & delete inclusively between two lines, please: Important: There are multiple }; lines. I'm curious how to delete the correct one only. Line numbers may vary each time this script is run. For example, I'd like to delete only the... (6 Replies)
Discussion started by: chatguy
6 Replies
DLSYM(3)						   BSD Library Functions Manual 						  DLSYM(3)

NAME
dlsym -- get address of a symbol SYNOPSIS
#include <dlfcn.h> void* dlsym(void* handle, const char* symbol); DESCRIPTION
dlsym() returns the address of the code or data location specified by the null-terminated character string symbol. Which libraries and bun- dles are searched depends on the handle parameter. If dlsym() is called with a handle, returned by dlopen() then only that image and any libraries it depends on are searched for symbol. If dlsym() is called with the special handle RTLD_DEFAULT, then all mach-o images in the process (except those loaded with dlopen(xxx, RTLD_LOCAL)) are searched in the order they were loaded. This can be a costly search and should be avoided. If dlsym() is called with the special handle RTLD_NEXT, then dyld searches for the symbol in the dylibs the calling image linked against when built. It is usually used when you intentionally have multiply defined symbol across images and want to find the "next" definition. It searches other images for the definition that the caller would be using if it did not have a definition. The exact search algorithm depends on whether the caller's image was linked -flat_namespace or -twolevel_namespace. For flat linked images, the search starts in the load ordered list of all images, in the image right after the caller's image. For two-level images, the search simulates how the static linker would have searched for the symbol when linking the caller's image. If dlsym() is called with the special handle RTLD_SELF, then the search for the symbol starts with the image that called dlsym(). If it is not found, the search continues as if RTLD_NEXT was used. If dlsym() is called with the special handle RTLD_MAIN_ONLY, then it only searches for symbol in the main executable. RETURN VALUES
The dlsym() function returns a null pointer if the symbol cannot be found, and sets an error condition which may be queried with dlerror(). NOTES
The symbol name passed to dlsym() is the name used in C source code. For example to find the address of function foo(), you would pass "foo" as the symbol name. This is unlike the older dyld APIs which required a leading underscore. If you looking up a C++ symbol, you need to use the mangled C++ symbol name. SEE ALSO
dlopen(3) dlerror(3) dyld(3) ld(1) cc(1) August 28, 2008
All times are GMT -4. The time now is 08:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy