02-04-2013
Thanks Corona, it works!
I'm seeing an extra <key>$</key> at the end of every output line though, but I can just batch delete that, thanks!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello
I need to search for a mult-line text in a file exfile1 and replace that text with another text. The text to search for is in exfile2 and the replacement text is in exfile3.
I work with kornshell under AIX and need to do this with a lot of files. (the file type is postscript and they need... (10 Replies)
Discussion started by: marz
10 Replies
2. Shell Programming and Scripting
Hi All,
I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text.
An example of 4 lines in my file is:
1. MatchText_randomNumberOfText moreData ReplaceMe moreData
2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Discussion started by: Crypto
4 Replies
3. UNIX for Dummies Questions & Answers
I have a text file with following content (3 lines)
filename : output.txt
first line:12/12/2008
second line:12/12/2008
third line:Y
I would like to know how we can replace 'Y' with 'N' in the 3rd line keeping 1st and 2nd lines same as what it was before.
I tried using cat output.txt... (4 Replies)
Discussion started by: santosham
4 Replies
4. Shell Programming and Scripting
I was google searching and found
Perl as a command line utility tool
This almost solves my problem:
find . | xargs perl -p -i.old -e 's/oldstring/newstring/g'
I think this would create a new file for every file in my directory tree. Most of my files will not contain oldstring and I... (1 Reply)
Discussion started by: siegfried
1 Replies
5. Shell Programming and Scripting
Hello,
I am trying to search and replace but I don't know how to do it. My simple knowlegde in search and replace using sed is not helping me at all.
File:
its a cause value #22: dfg ggg
Cause value #1: aasfa fasdf
asfa value #22: affg gggg
Basically i want to replace the... (6 Replies)
Discussion started by: balan1983a
6 Replies
6. Shell Programming and Scripting
You have two files to compare by searching keyword from one file into another file
File A
23 >pp_ANSWER
24 >aa hello
25 >jau head wear
66 >jss oops
872 >aqq olps ploww oww sss
722 >GG_KILLER
..... large files
File B
Beta done
KILLER
John Mayor
calix meyers
... (5 Replies)
Discussion started by: cdfd123
5 Replies
7. Shell Programming and Scripting
Hello,
I am very new to Linux and am trying to find a way for following problem.
I have a number of files in a folder as Export000.dat, Export001.dat ..and so on.
Each file has a string field 'Absolute velocity'. I want it to be replaced by 'Pixel shift' in all the files. I tried something like... (4 Replies)
Discussion started by: chirag.joshi
4 Replies
8. Shell Programming and Scripting
I have to search for a keyword (UTF-16) in xml file and if the keyword is found i have to convert the encoding type in the file to UTF-8 and then replace the keyword inside the file from UTF-16 to UTF-8.
I have the code which is working for one file but for number of files in a path its not... (2 Replies)
Discussion started by: Shruthi8818
2 Replies
9. UNIX for Advanced & Expert Users
HI
I have property files having content
QA_server_name=10.232.54.7
QA_port_number=18000
DEV_server_name=10.235.60.73
DEV_port_number=18000
and a .jason file having content like this
{
"server":"localhost"
"port":"17000"
------
}
I will get the parameter... (1 Reply)
Discussion started by: mdtausifsh
1 Replies
10. Shell Programming and Scripting
Hi
I want to implement something like this:
if( keyword1 exists)
then
check if(keyword2 exists in the same line)
then replace keyword 2 with New_Keyword
else
Add New_Keyword at the end of line
end if
eg:
Check for Keyword JUNGLE and add/replace... (7 Replies)
Discussion started by: dashing201
7 Replies
LEARN ABOUT DEBIAN
kinosearch1::analysis::tokenbatch
KinoSearch1::Analysis::TokenBatch(3pm) User Contributed Perl Documentation KinoSearch1::Analysis::TokenBatch(3pm)
Add many tokens to the batch, by supplying the string to be tokenized, and arrays of token starts and token ends (specified in bytes).
NAME
KinoSearch1::Analysis::TokenBatch - a collection of tokens
SYNOPSIS
while ( $batch->next ) {
$batch->set_text( lc( $batch->get_text ) );
}
EXPERIMENTAL API
TokenBatch's API should be considered experimental and is likely to change.
DESCRIPTION
A TokenBatch is a collection of Tokens which you can add to, then iterate over.
METHODS
new
my $batch = KinoSearch1::Analysis::TokenBatch->new;
Constructor.
append
$batch->append( $text, $start_offset, $end_offset, $pos_inc );
Add a Token to the end of the batch. Accepts either three or four arguments: text, start_offset, end_offset, and an optional position
increment which defaults to 1 if not supplied. For a description of what these arguments mean, see the docs for Token.
next
while ( $batch->next ) {
# ...
}
Proceed to the next token in the TokenBatch. Returns true if the TokenBatch ends up located at valid token.
ACCESSOR METHODS
All of TokenBatch's accessor methods affect the current Token. Calling any of these methods when the TokenBatch is not located at a valid
Token will trigger an exception.
set_text get_text
Set/get the text of the current Token.
set_start_offset get_start_offset
Set/get the start_offset of the current Token.
set_end_offset get_end_offset
Set/get the end_offset of the current Token.
set_pos_inc get_pos_inc
Set/get the position increment of the current Token.
COPYRIGHT
Copyright 2005-2010 Marvin Humphrey
LICENSE, DISCLAIMER, BUGS, etc.
See KinoSearch1 version 1.00.
perl v5.14.2 2011-11-15 KinoSearch1::Analysis::TokenBatch(3pm)