Sponsored Content
Top Forums Shell Programming and Scripting Inserting new line if two sequential lines begin with the same string Post 302865383 by majormajormajor on Friday 18th of October 2013 09:31:47 AM
Old 10-18-2013
brilliant. thankyou so much!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Inserting new line after match of a fixed string

Hi, I have a file which contains many occurances of a string say "hellosunil". I want to insert a newline charcater after all the "hellosunil" strings in the file. trying to use sed, sed -e 's/hellosunil/\\nhellosunil/g' file1 sed help says u cannot substitute a regular expression... (6 Replies)
Discussion started by: sunil_neha
6 Replies

2. UNIX for Dummies Questions & Answers

inserting uniq sequential numbers at the start of the file

Hi Unix gurus, I have a file. I need to insert sequential number at the starting of the file. Fields are delimited by "|". I know the starting number. Example: File is as follows |123|4test|test |121|2test|test |x12|1test|test |vd123|5test|test starting number is : 120 ... (7 Replies)
Discussion started by: jingi1234
7 Replies

3. Programming

Reading special characters while converting sequential file to line sequential

We have to convert a sequential file to a 80 char line sequential file (HP UX platform).The sequential file contains special characters. which after conversion of the file to line sequential are getting coverted into "new line" or "tab" and file is getting distorted. Is there any way to read these... (2 Replies)
Discussion started by: Rajeshsu
2 Replies

4. Shell Programming and Scripting

Append specific lines to a previous line based on sequential search criteria

I'll try explain this as best I can. Let me know if it is not clear. I have large text files that contain data as such: 143593502 09-08-20 09:02:13 xxxxxxxxxxx xxxxxxxxxxx 09-08-20 09:02:11 N line 1 test line 2 test line 3 test 143593503 09-08-20 09:02:13... (3 Replies)
Discussion started by: jesse
3 Replies

5. Shell Programming and Scripting

search string in a file and retrieve 10 lines including string line

Hi Guys, I am trying to write a perl script to search a string "Name" in the file "FILE" and also want to create a new file and push the searched string Name line along with 10 lines following the same. can anyone of you please let me know how to go about it ? (8 Replies)
Discussion started by: sukrish
8 Replies

6. Shell Programming and Scripting

sequential to line sequential

Hi I have a file sequential way i.e. written in contineous mode and the Record Seperator is AM from which the record is seperated .Now to process I have to make line sequential,and more over record length is not same it varies as per the input address, AM1234563 John Murray 24 Old streeet old... (5 Replies)
Discussion started by: vakharia Mahesh
5 Replies

7. Shell Programming and Scripting

Grep a string from input file and delete next three lines including the line contains string in xml

Hi, 1_strings file contains $ cat 1_strings /home/$USER/Src /home/Valid /home/Review$ cat myxml <projected value="some string" path="/home/$USER/Src"> <input 1/> <estimate value/> <somestring/> </projected> <few more lines > <projected value="some string" path="/home/$USER/check">... (4 Replies)
Discussion started by: greet_sed
4 Replies

8. UNIX for Dummies Questions & Answers

Inserting a sequential number into a field on a flat file

I have a csv flatfile with a few million rows. I need to replace a field (field number is 85) in the file with a sequential number. As an example, let's assume there are only 4 fields in the file: A,A,,32 A,A,,27 A,B,,43 C,C,,354 If I wanted to amend the 3rd field in this way my... (2 Replies)
Discussion started by: BristolSmithy
2 Replies

9. Shell Programming and Scripting

Inserting blank lines after string change

My input data looks like this ... -150 120 8 -150 122 7 -150 124 11 -150 126 8 -150 128 19 -150 130 13 -150 132 26 -150 134 38 -150 136 45 -150 138 62 -150 140 75 -150 142 110 -150 144 139 -150 146 138 -150 148 158 -150 150 173 -150 152 217 (5 Replies)
Discussion started by: chrisjorg
5 Replies

10. Shell Programming and Scripting

Insert String every n lines, resetting line counter at desired string

I need to read a text file and insert a string every n lines, but also have the line counter restart when I come across a header string. Line repeating working every 3 lines using code: sed '0~3 s/$/\nINSERT/g' < INPUT/PATH/FILE_NAME.txt > OUTPUT/PATH/FILE_NAME.txt I cannot seem to find... (1 Reply)
Discussion started by: Skonectthedots
1 Replies
Plucene(3pm)						User Contributed Perl Documentation					      Plucene(3pm)

NAME
Plucene - A Perl port of the Lucene search engine SYNOPSIS
Create Documents by adding Fields: my $doc = Plucene::Document->new; $doc->add(Plucene::Document::Field->Text(content => $content)); $doc->add(Plucene::Document::Field->Text(author => "Your Name")); Choose Your Analyser and add documents to an Index Writer my $analyzer = Plucene::Analysis::SimpleAnalyzer->new(); my $writer = Plucene::Index::Writer->new("my_index", $analyzer, 1); $writer->add_document($doc); undef $writer; # close Search by building a Query my $parser = Plucene::QueryParser->new({ analyzer => Plucene::Analysis::SimpleAnalyzer->new(), default => "text" # Default field for non-specified queries }); my $query = $parser->parse('author:"Your Name"'); Then pass the Query to an IndexSearcher and collect hits my $searcher = Plucene::Search::IndexSearcher->new("my_index"); my @docs; my $hc = Plucene::Search::HitCollector->new(collect => sub { my ($self, $doc, $score) = @_; push @docs, $searcher->doc($doc); }); $searcher->search_hc($query => $hc); DESCRIPTION
Plucene is a fully-featured and highly customizable search engine toolkit based on the Lucene API. (<http://jakarta.apache.org/lucene>) It is not, in and of itself, a functional search engine - you are expected to subclass and tie all the pieces together to suit your own needs. The synopsis above gives a rough indication of how to use the engine in simple cases. See Plucene::Simple for one example of tying it all together. The tests shipped with Plucene provide a variety of other examples of how use this. EXTENSIONS
Plucene comes shipped with some default Analyzers. However it is expected that users will want to create Analyzers to meet their own needs. To avoid namespace corruption, anyone releasing such Analyzers to CPAN (which is encouraged!) should place them in the namespace Plucene::Plugin::Analyzer::. DOCUMENTATION
Although most of the Perl modules should be well documented, the Perl API mirrors Lucene's to such an extent that reading Lucene's documentation will give you a good idea of how to do more advanced stuff with Plucene. See particularly the ONJava articles <http://www.onjava.com/pub/a/onjava/2003/01/15/lucene.html> and <http://www.onjava.com/pub/a/onjava/2003/03/05/lucene.html>. These are brilliant introductions to the concepts surrounding Lucene, how it works, and how to extend it. COMPATIBILITY
For the most part Lucene and Plucene indexes are created in the same manner. However, due to current implementation details, the indexes will generally not be compatible. It should theoretically be possible to convert index files in either direction between Plucene and Lucene, but no tools are currently provided to do so. As Plucene is still undergoing development, we cannot guarantee index format compatibility across releases. If you're using Plucene in production code, you need to ensure that you can recreate the indexes. MISSING FEATURES
The following features have not yet been fully implemented: o Wildcard searches o Range searches MAILING LIST
Bug reports, patches, queries, discussion etc should be addressed to the mailing list. More information on the list can be found at: <http://www.kasei.com/mailman/listinfo/plucene> AUTHORS
Initially ported by Simon Cozens and Marc Kerr. Currently maintained by Tony Bowden and Marty Pauley. Original Java Lucene by Doug Cutting and others. THANKS
The initial development and ongoing maintenance of Plucene has been funded and supported by Kasei <http://www.kasei.com/> LICENSE
This software is licensed under the same terms as Perl itself. perl v5.12.4 2011-08-14 Plucene(3pm)
All times are GMT -4. The time now is 02:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy