Sponsored Content
Full Discussion: Sed variables
Top Forums Shell Programming and Scripting Sed variables Post 302244735 by Zenwork on Wednesday 8th of October 2008 01:38:04 PM
Old 10-08-2008
Great - Thanks

Thanks for your help.

Zenwork - A beginner script writer...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

doing a sed with variables

Hi, I'm trying to do the following , I have certain variables in a file and then I want to check for these variables in a certain cobol file to see if they contain a certain package if so replace them with value 1 but but that last line is giving problems: # for each variable in SQL file ... (1 Reply)
Discussion started by: seaten
1 Replies

2. Shell Programming and Scripting

doing a sed with variables

Hi, I'm trying to do the following , I have certain variables in a file and then I want to check for these variables in a certain cobol file to see if they contain a certain package if so replace them with value 1 but but that last line is giving problems: # for each variable in SQL file ... (1 Reply)
Discussion started by: seaten
1 Replies

3. UNIX for Dummies Questions & Answers

doing a sed on certain variables

Hi guys, I want to replace certain values with the number 1. But it is also replacing other values which contain the value I want to replace. e.g.: I want to replace ID-INTERNAL with 1, that's no problem but it will also replace ID-INTERNAL-NON-REM with 1-NON-REM I don't want to... (10 Replies)
Discussion started by: seaten
10 Replies

4. Shell Programming and Scripting

variables in sed

when i do something like substituting a particular thing with a system variable, i am unable to do that expect the varible name getting into that. for ex.. i tried, sed -e 's/date/`date`/g' <if >of but i got date replaced with "`date`" and not with the actual date .. same case happened... (5 Replies)
Discussion started by: sskb
5 Replies

5. Shell Programming and Scripting

Using sed with variables (again!)

Hi, I'm trying to use sed to delete the last three lines of a file. I currently have: # get the amount of lines in the file foldernum=`wc -l File_In.txt | cut -c1-8` # remove the lines in the file sed "${foldernum}-3,${foldernum}d" File_In.txt > File_Out.txt I get the error - sed:... (5 Replies)
Discussion started by: Mr_Plow
5 Replies

6. Shell Programming and Scripting

using variables with sed

I'm trying to get sed to cut and replace using variables, but it doesnt seem to work, when I run this the mod time of the file does get updated. Is my syntax incorrect in the sed command? Thanks #!/usr/bin/ksh #Modify header set -x HEAD=$(cat PBN2CPR1.TXT | awk 'BEGIN { FS = ","... (1 Reply)
Discussion started by: ddurden7
1 Replies

7. UNIX for Dummies Questions & Answers

sed using variables

Hi, I am able to use sed if I hardcode the find and replace values in a shell script. This works: sed -e 's/123v/4567/g' /path/aaa.txt > /path/aaa.txt.tmp If I use a variable, I am not able to use sed command. why? This doesnot work: i=abc j=bk${i} sed -e 's/${i}/${j}/g'... (5 Replies)
Discussion started by: new_learner
5 Replies

8. Shell Programming and Scripting

variables and sed

Is it possible to place a variable in a sed command as such? sed 's/ret_Priv()/$var/' <filename> I am doing this under Bourne. (5 Replies)
Discussion started by: plslakewood
5 Replies

9. Shell Programming and Scripting

Using Variables with SED

All I am trying to produce the following in /etc/ssh/sshd_config, # IPv4 only #ListenAddress 0.0.0.0 # IPv4 & IPv6 ListenAddress :: to # IPv4 only ListenAddress <user-entry> ListenAddress <user-entry> # IPv4 & IPv6 #ListenAddress :: The number of user entries can vary. ... (1 Reply)
Discussion started by: miyoung999
1 Replies

10. Shell Programming and Scripting

sed with variables

Im trying to use sed to print value that matches the value in variable and all lines after that. grep "Something" test.txt | sed -e '/{$variable}/,$b' -e 'd' I cant get it work, if I replace the $variable with the value it contains, it works fine... (10 Replies)
Discussion started by: olkkis
10 Replies
Plucene::Index::Writer(3pm)				User Contributed Perl Documentation			       Plucene::Index::Writer(3pm)

NAME
Plucene::Index::Writer - write an index. SYNOPSIS
my $writer = Plucene::Index::Writer->new($path, $analyser, $create); $writer->add_document($doc); $writer->add_indexes(@dirs); $writer->optimize; # called before close my $doc_count = $writer->doc_count; my $mergefactor = $writer->mergefactor; $writer->set_mergefactor($value); DESCRIPTION
This is the writer class. If an index will not have more documents added for a while and optimal search performance is desired, then the "optimize" method should be called before the index is closed. METHODS
new my $writer = Plucene::Index::Writer->new($path, $analyser, $create); This will create a new Plucene::Index::Writer object. The third argument to the constructor determines whether a new index is created, or whether an existing index is opened for the addition of new documents. mergefactor / set_mergefactor my $mergefactor = $writer->mergefactor; $writer->set_mergefactor($value); Get / set the mergefactor. It defaults to 5. doc_count my $doc_count = $writer->doc_count; add_document $writer->add_document($doc); Adds a document to the index. After the document has been added, a merge takes place if there are more than $Plucene::Index::Writer::mergefactor segments in the index. This defaults to 10, but can be set to whatever value is optimal for your application. optimize $writer->optimize; Merges all segments together into a single segment, optimizing an index for search. This should be the last method called on an indexer, as it invalidates the writer object. add_indexes $writer->add_indexes(@dirs); Merges all segments from an array of indexes into this index. This may be used to parallelize batch indexing. A large document collection can be broken into sub-collections. Each sub-collection can be indexed in parallel, on a different thread, process or machine. The complete index can then be created by merging sub-collection indexes with this method. After this completes, the index is optimized. perl v5.12.4 2011-08-14 Plucene::Index::Writer(3pm)
All times are GMT -4. The time now is 01:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy