Sponsored Content
Top Forums Shell Programming and Scripting sed to find replace mutliline text Post 302366441 by vasanth.vadalur on Thursday 29th of October 2009 01:40:41 PM
Old 10-29-2009
Dear protocomm,

your code worked well and thanks a lot.

Thanks
vasanth

---------- Post updated at 09:40 AM ---------- Previous update was at 09:14 AM ----------

Dear Protocomm,

Your code worked, but for more than 8 lines the desired output fails.

Desired output:

Code:
Check for form
check above and below  fill word
if above and below fill found, then it is category2.
If only one filll either above or belo, then category1.

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace Text with sed

Hi , I´m working on Solaris 9 SPARC and I´m writing a Script to mírror two disks.. I need to replace some text in a file ( /etc/vfstab ) . For example: /dev/dsk/c0t0d0s0 ==> /dev/md/dsk/d0 I just want to change the "/dev/dsk/" to "/dev/md/dsk/. Thanks for your repsonse (5 Replies)
Discussion started by: networkfre@k
5 Replies

2. UNIX for Dummies Questions & Answers

Find and replace text

test 100 abc test 134 bcd test 356 cdf test 831 dfg test 720 fgh Please advise how can I replace the abc, bcd....with ABC, BCD.... (1 Reply)
Discussion started by: bobo
1 Replies

3. UNIX for Dummies Questions & Answers

Find and replace text PLEASE HELP

Dear friends please help, I have a large data file with few hundred lines. A small example is shown below: datafile is a file with few hundred lines with the third column has many different character stings: test 100 abc test 134 bcd test 356 cdf test 831 dfg test 720 fgh I need to... (6 Replies)
Discussion started by: bobo
6 Replies

4. Shell Programming and Scripting

find text but replace a text beside it

I have an html file that looks like this (this is just a part of the html file): <td colspan="3" rowspan="1" style="text-align: center; background-color: rgb(<!-- IDENTIFIER1 -->51, 255, 51);"><small><!-- IDENTIFIER2 -->UP</small></td> This is to automatically update the status of the... (4 Replies)
Discussion started by: The One
4 Replies

5. Shell Programming and Scripting

Help with sed - replace text

Hi, I need to replace text in a file. Can someone help me write the proper sed command for this? My text file contains about a 100 lines of content. I want to replace the line containing new_name = "#{options}-#{ENV}" by, the following - new_name = "#{options}-#{ENV}-#{rand(999)}" ... (1 Reply)
Discussion started by: ankush2kn
1 Replies

6. Shell Programming and Scripting

replace text with SED

Hi, I hope someone can help me out with the following: I have a file with the following lines in it: something /path/dir/my_-_file.01.ext sometext sometext somethingelse /path/dir/my_-_file.02.ext sometext something /path/dir/my_-_file.03.ext sometext some other text And i want to... (3 Replies)
Discussion started by: thyssimonis
3 Replies

7. Shell Programming and Scripting

Find and add/replace text in text files

Hi. I would like to have experts help on below action. I have text files in which page nubmers exists in form like PAGE : 1 PAGE : 2 PAGE : 3 and so on there is other text too. I would like to know is it possible to check the last occurance of Page... (6 Replies)
Discussion started by: lodhi1978
6 Replies

8. Shell Programming and Scripting

sed help, Find a pattern, replace it with same text minus leading 0

HI Folks, I'm looking for a solution for this issue. I want to find the Pattern 0/ and replace it with /. I'm just removing the leading zero. I can find the Pattern but it always puts literal value as a replacement. What am I missing?? sed -e s/0\//\//g File1 > File2 edit by... (3 Replies)
Discussion started by: SirHenry1
3 Replies

9. Shell Programming and Scripting

Find and replace using sed

Hi All, I have a file as shown below: myFile.dat #---------------------------------------------------------- dataFile { Name shiva; location Delhi; travelID IDNumber; } 4 ( 560065 700007 100001 200002 )... (8 Replies)
Discussion started by: linuxUser_
8 Replies

10. Shell Programming and Scripting

sed Find and Replace Text Between Two Strings or Words

I am looking for a sed in which I can recognize all of the text in between two indicators and then replace it with a place holder. For instance, the 1st indicator is a list of words "no|noone|havent" and the 2nd indicator is a list of punctuation ".|,|!".From a sentence such as "noone... (3 Replies)
Discussion started by: owwow14
3 Replies
Text::MeCab::Dict(3pm)					User Contributed Perl Documentation				    Text::MeCab::Dict(3pm)

NAME
Text::MeCab::Dict - Utility To Work With MeCab Dictionary SYNOPSIS
use Text::MeCab::Dict; my $dict = Text::MeCab::Dict->new( dict_source => "/path/to/mecab-ipadic-source" ); $dict->add( surface => $surface, # XXX left_id => $left_id, # XXXID right_id => $right_id, # XXXID cost => $cost, # XXX pos => $part_of_speech, # XX category1 => $category1, # XXXXX1 category2 => $category2, # XXXXX2 category3 => $category3, # XXXXX3 # XXX this below two parameter names need blessing from a knowing # expert, and is subject to change inflect => $inflect, # XXX inflect_type => $inflect_type, # XXX original => $original, # XX yomi => $yomi, # XX pronounce => $pronounce, # XX extra => @extras, # XXXXXX ); $dict->write('foo.csv'); $dict->rebuild(); METHODS
new Creates a new instance of Text::MeCab::Dict. The path to the source of mecab-ipadic is required: my $dict = Text::MeCab::Dict->new( dict_source => "/path/to/mecab-ipadic-source" ); If you are in an environment where mecab-config is NOT available, you must also specify libexecdir, which is where mecab-dict-index is installed: my $dict = Text::MeCab::Dict->new( dict_source => "/path/to/mecab-ipadic-source", libexecdir => "/path/to/mecab/libexec/", ); add Adds a new entry to be appended to the dictionary. Please see SYNOPSIS for arguments. write Writes out the entries that were added via add() to the specified file location. If the file name does not look like an absolute path, the name will be treated relatively from dict_source rebuild Rebuilds the index. This usually requires that you are have root privileges SEE ALSO
http://mecab.sourceforge.net/dic.html perl v5.14.2 2011-07-15 Text::MeCab::Dict(3pm)
All times are GMT -4. The time now is 08:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy