Sponsored Content
Top Forums Shell Programming and Scripting remove contents including the tag if pattern matches Post 302527389 by getmmg on Friday 3rd of June 2011 08:06:19 AM
Old 06-03-2011
Check if this works.

Code:
 
perl -lne 'print if !/pharmacy/' te

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting XML Tag Contents

Hi Jean I require your help in writing a shell script. Iam zero in Unix programming. I have a large file about 400 MB of data, which contains about 50000 XML messages seperated by a Tab, I think. I need to extract only 4 values from each XML message and write it onto a new file. Please help me... (2 Replies)
Discussion started by: pk_eee
2 Replies

2. Shell Programming and Scripting

sed: Find start of pattern and extract text to end of line, including the pattern

This is my first post, please be nice. I have tried to google and read different tutorials. The task at hand is: Input file input.txt (example) abc123defhij-E-1234jslo 456ujs-W-abXjklp From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
Discussion started by: TestTomas
5 Replies

3. Shell Programming and Scripting

Remove if the above line matches pattern

but keep if does not I have a file: --> my.out foo: bar foo: moo blarg i am on vacation foo: goose foo: lucy foo: moose foo: stucky groover@monkey.org foo: bozo grimace@gonzo.net dear sir - blargo blargo foo: goon foo: sloppy foo: saudi gimme gimme gimme (3 Replies)
Discussion started by: spacegoose
3 Replies

4. Shell Programming and Scripting

Search for Pattern and Print including Lines in between

Gurus, I have a big file that needs to be sorted out and I cant figure out what to do. The file name is as below: Name: xxxx yyyy nnnn Description: dfffgs sdgsgsf hsfhhs afgghhjdgj fjklllll gsfhfh Updated: jafgadsgg gsg Corrected: date today The file consists of line like these. ... (13 Replies)
Discussion started by: The One
13 Replies

5. Shell Programming and Scripting

NAWK to remove lines that matches a specific pattern

Hi, I have requirement that I need to split my input file into two files based on a search pattern "abc" For eg. my input file has below content abc defgh zyx I need file 1 with abc and file2 with defgh zyx I can use grep command to acheive this. But with grep I need... (8 Replies)
Discussion started by: sbhuvana20
8 Replies

6. UNIX for Dummies Questions & Answers

If user input matches file contents

I was wondering how I can read values from a file and then proceed if those values match a user input. For example (a simple one), a user inputs their name, then we check if that name is in a file of usernames. If it is, it says proceed, if not, then it says you are not authorized. ... (5 Replies)
Discussion started by: DBnixUser
5 Replies

7. Shell Programming and Scripting

How to use ls with pattern and including path?

Hello to all, Maybe someone could help me, my question is: How can a filter the print of command ls for the files with names of the form "abc*.txt" including the path? I've done this: If I move with command cd to /My/Path/Is/This/ and send this command: ls -lst abc*.txt -i... (37 Replies)
Discussion started by: Ophiuchus
37 Replies

8. Shell Programming and Scripting

Remove entire line from a file if 1st column matches a pattern

I have one requirement to delete all lines from a file if it matches below scenario. File contains three column. Employee Number, Employee Name and Employee ID Scenario is: delete all line if Employee Number (1st column) contains below 1. Non-numeric Employee Number 2. Employee Number that... (3 Replies)
Discussion started by: anshu ranjan
3 Replies

9. Shell Programming and Scripting

Moving XML tag/contents after specific XML tag within same file

Hi Forum. I have an XML file with the following requirement to move the <AdditionalAccountHolders> tag and its content right after the <accountHolderName> tag within the same file but I'm not sure how to accomplish this through a Unix script. Any feedback will be greatly appreciated. ... (19 Replies)
Discussion started by: pchang
19 Replies

10. Shell Programming and Scripting

Delete a pattern including any whitespace before it and after it

Hello. A_LIGNE="cnezJ,V ,FMZ fd,Mok CODKJ,F SOME_WORD fcnQ, VMQKV Q" A_PATTERN="SOME_WORD" sed 's/'$A_PATTERN'//g' <<< "$A_LINE"will remove 'SOME_WORD' and give : "cnezJ,V ,FMZ fd,Mok CODKJ,F fcnQ, VMQKV Q"A_PATTERN="SOME_WORD]" sed 's/'$A_PATTERN'//g' <<< "$A_LINE"will remove... (4 Replies)
Discussion started by: jcdole
4 Replies
RDF::Query::Algebra::Union(3pm) 			User Contributed Perl Documentation			   RDF::Query::Algebra::Union(3pm)

NAME
RDF::Query::Algebra::Union - Algebra class for Union patterns VERSION
This document describes RDF::Query::Algebra::Union version 2.908. METHODS
Beyond the methods documented below, this class inherits methods from the RDF::Query::Algebra class. "new ( $left, $right )" Returns a new Union structure. "construct_args" Returns a list of arguments that, passed to this class' constructor, will produce a clone of this algebra pattern. "first" Returns the first pattern (LHS) of the union. "second" Returns the second pattern (RHS) of the union. "patterns" Returns the two patterns belonging to the UNION pattern. "sse" Returns the SSE string for this algebra expression. "as_sparql" Returns the SPARQL string for this algebra expression. "as_hash" Returns the query as a nested set of plain data structures (no objects). "type" Returns the type of this algebra expression. "referenced_variables" Returns a list of the variable names used in this algebra expression. "potentially_bound" Returns a list of the variable names used in this algebra expression that will bind values during execution. "definite_variables" Returns a list of the variable names that will be bound after evaluating this algebra expression. AUTHOR
Gregory Todd Williams <gwilliams@cpan.org> perl v5.14.2 2012-01-31 RDF::Query::Algebra::Union(3pm)
All times are GMT -4. The time now is 05:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy