Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Search special characters in a file and replace with meaningful text messages like Hello Post 302951830 by raka_rjit on Tuesday 11th of August 2015 04:11:38 AM
Old 08-11-2015
Error Search special characters in a file and replace with meaningful text messages like Hello

Search special characters in a file and replace with meaningful text messages like Hello
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

search special characters in a file

Hello I am new to shell scripting and can anyone tell me how to check if there are any special characters in a file. Can i use grep ? thanks susie (2 Replies)
Discussion started by: cramya80
2 Replies

2. UNIX for Dummies Questions & Answers

Replace Special characters in a file

Hi, I have a data like this in a file, 402003279034002000100147626030003300010000000000002000029000000 ær^M^\MÍW^H I need to replace those special char to some other char like # or $ Is there any ways to do it... I tried commands tr,sed and many but it was not able to replace because... (1 Reply)
Discussion started by: solai
1 Replies

3. UNIX for Dummies Questions & Answers

Find and replace special characters in a file

HI All I need a shell script ehich removes all special characters from file and converts the file to UTF-* format Specail characters to be removed must be configurable. strIllegal = @"?/><,:;""'{|\\+=-)(*&^%$#@!~`"; Please help me in getting this script as my scripting skilla are... (2 Replies)
Discussion started by: sujithchandra
2 Replies

4. Shell Programming and Scripting

Search and replace particular characters in fixed length-file

Masters, I have fixed length input file like FHEAD0000000001XXXX20090901 0000009000Y1000XXX2 THEAD000000000220090901 ITM0000109393813 430143504352N22SP 000000000000RN000000010000EA P0000000000000014390020090901 TTAIL0000000003000000 FTAIL00000000040000000002 Note... (4 Replies)
Discussion started by: bittoo
4 Replies

5. Shell Programming and Scripting

Remove special characters from text file

Hi All, i am trying to remove all special charecters().,/\~!@#%^$*&^_- and others from a tab delimited file. I am using the following code. while read LINE do echo $LINE | tr -d '=;:`"<>,./?!@#$%^&(){}'|tr -d "-"|tr -d "'" | tr -d "_" done < trial.txt > output.txt Problem ... (10 Replies)
Discussion started by: kkb
10 Replies

6. Shell Programming and Scripting

Adding text to file on certain lines with(special characters)

I need to add "new lines" of text with special characters, to specific lines in the file. There are 3 modifications needed. Been testing 2 here without success. #!/usr/bin/perl use FileHandle; $file=FileHandle->new; $FILENAME="/opt/etc/usr/file.txt"; $file->open ("<$FILENAME") or die... (13 Replies)
Discussion started by: A4ron4perl
13 Replies

7. Shell Programming and Scripting

Replace special characters

I have a line ending with special character and 0 The special character is the field separator for this line in VI mode the file will look like below, but while cat the special character wont display i know the hexa code for the special character ^_ is \x1f and ascii code is \0037, ... (0 Replies)
Discussion started by: ratheeshjulk
0 Replies

8. Shell Programming and Scripting

Replace special characters with Escape characters?

i need to replace the any special characters with escape characters like below. test!=123-> test\!\=123 !@#$%^&*()-= to be replaced by \!\@\#\$\%\^\&\*\(\)\-\= (8 Replies)
Discussion started by: laknar
8 Replies

9. UNIX for Dummies Questions & Answers

How to enter special characters in a text file using vi?

Hi, I need to create a test text file with the special characters \342\200\223 in it and to be able to use sed maybe to delete them I tried doing it using vi by pressing CTRL-V and then typing 342 but it does not work. After pressing CTRL-V and typing 342 it seems to just insert the numbers... (1 Reply)
Discussion started by: newbie_01
1 Replies

10. UNIX for Advanced & Expert Users

How to replace special characters?

Hi Team, I have data like this. |*|.5|*|0.2|*|A.B|*| Would like to add zero (0) before the decimal point where there is no zero as |*|0.5|*|0.2|*|A.B|*| How to replace |*|. with |*|0. I tried below command which didn't work echo '|*|.5|*|0.2|*|A.B|*' | sed... (4 Replies)
Discussion started by: Ravi.K
4 Replies
Xapian::TermGenerator(3pm)				User Contributed Perl Documentation				Xapian::TermGenerator(3pm)

NAME
Search::Xapian::TermGenerator - Parses a piece of text and generates terms. DESCRIPTION
This module takes a piece of text and parses it to produce words which are then used to generate suitable terms for indexing. The terms generated are suitable for use with Search::Xapian::Query objects produced by the Search::Xapian::QueryParser class. SYNOPSIS
use Search::Xapian; my $doc = new Search::Xapian::Document(); my $tg = new Search::Xapian::TermGenerator(); $tg->set_stemmer(new Search::Xapian::Stem("english")); $tg->set_document($doc); $tg->index_text("The cat sat on the mat"); METHODS
new TermGenerator constructor. set_stemmer <stemmer> Set the Search::Xapian::Stem object to be used for generating stemmed terms. set_stopper <stopper> Set the Search::Xapian::Stopper object to be used for identifying stopwords. set_document <document> Set the Search::Xapian::Document object to index terms into. get_document <document> Get the currently set Search::Xapian::Document object. index_text <text> [<weight> [<prefix>]] Indexes the text in string <text>. The optional parameter <weight> sets the wdf increment (default 1). The optional parameter <prefix> sets the term prefix to use (default is no prefix). index_text_without_positions <text> [<weight> [<prefix>]] Just like index_text, but no positional information is generated. This means that the database will be significantly smaller, but that phrase searching and NEAR won't be supported. increase_termpos [<delta>] Increase the termpos used by index_text by <delta> (default 100). This can be used to prevent phrase searches from spanning two unconnected blocks of text (e.g. the title and body text). get_termpos Get the current term position. set_termpos <termpos> Set the current term position. get_description Return a description of this object. REFERENCE
http://www.xapian.org/docs/sourcedoc/html/classXapian_1_1TermGenerator.html perl v5.14.2 2012-05-09 Xapian::TermGenerator(3pm)
All times are GMT -4. The time now is 08:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy