06-13-2013
I need to extract uique words from text file
Hello programmers,
I need to create a list of unique words from a text file using PERL...may i have the code for that please?
Thank you
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How can i read all the unique words in a file, i used -
cat comment_file.txt | /usr/xpg6/bin/tr -sc 'A-Za-z' '/012'
and
cat comment_file.txt | /usr/xpg6/bin/tr -sdc 'A-Za-z' '/012'
but they didnt worked..... (5 Replies)
Discussion started by: aditya.ece1985
5 Replies
2. Programming
needa c program to extract text between two delimiters from some text file.
and then storing them in to diffrent variables ?
text file like 0:
abc.txt
=========
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass... (7 Replies)
Discussion started by: kukretiabhi13
7 Replies
3. UNIX for Dummies Questions & Answers
Hi Guys,
While I was writing one shell script , I just got struck at this point.
I need to extract words from a file at some specified position and do some comparison operation and need to replace the extracted word with another word.
Eg : I like Orange very much.
I need to replace... (19 Replies)
Discussion started by: kuttu123
19 Replies
4. UNIX for Dummies Questions & Answers
Hi there, Unix Gurus
Working with big listings of english sentences for my pupils, of the type:
1. If the boss's son had been , someone would have asked for money by now.
2. Look, I haven't a crime, so why can't you let me go?
....
I wondered how to extract the words between brackets in... (7 Replies)
Discussion started by: eldeingles
7 Replies
5. UNIX for Dummies Questions & Answers
Hi Guys,
Can someone help me with a way to extract text between two words on a single line.
For example if the file has below content I want to extract all text between b and f inclusive of b and f. Aparently sed does this but does it line by line and I guess it cannot read word by word.
... (11 Replies)
Discussion started by: krishnaux
11 Replies
6. Shell Programming and Scripting
i need to extract the string between two tags,
input file is
<PersonInfoShipTo AddressID="446311709" AddressLine1="" AddressLine2="" AddressLine3="" AddressLine4="" AddressLine5="" AddressLine6="" AlternateEmailID="" Beeper="" City="" Company="" Country="" DayFaxNo="" DayPhone="" Department=""... (5 Replies)
Discussion started by: Padmanabhan
5 Replies
7. Shell Programming and Scripting
I have a long list of alphanumberic words (no spaces or characters) in file1.txt I need to check for the existance of each of the words from file1.txt against file2.txt and if the word is NOT in file2.txt, I need to know about it, either standard output or redirect to file3.txt
For example:... (5 Replies)
Discussion started by: ajp7701
5 Replies
8. Shell Programming and Scripting
Hello,
I want to grep a log ("server.log") for words in a separate file ("white-list.txt") and generate a separate log file containing each line that uses a word from the "white-list.txt" file.
Putting that in bullet points:
Search through "server.log" for lines that contain any word... (15 Replies)
Discussion started by: nbsparks
15 Replies
9. Shell Programming and Scripting
Hi Guys..
I have a file and i want to extract all words that starts with a pattern 'ABC_' or 'ADF_'
For example,
ABC.txt
----
INSERT INTO ABC_DLKFJAL_FJKLD
SELECT DISTINCT S,B,C FROM ADF_DKF_KDFJ_IERU8 A, ABC_LKDJFREUE9_FJKDF B
WHERE A.FI=B.EI;
COMMIT;
Output : ABS_DLKFJAL_FJKLD,... (5 Replies)
Discussion started by: Pramod_009
5 Replies
10. UNIX for Beginners Questions & Answers
hi I made this simple script to extract data and pretty much is a list and would like to extract data of two words separated by commas and I would like to make a new text file that would list these extracted data into a list and each in a new line.
Example that worked for me with text file... (5 Replies)
Discussion started by: dandaryll
5 Replies
LEARN ABOUT OPENDARWIN
slapd-perl
SLAPD-PERL(5) File Formats Manual SLAPD-PERL(5)
NAME
slapd-perl - Perl backend to slapd
SYNOPSIS
/etc/openldap/slapd.conf
DESCRIPTION
The Perl backend to slapd(8) works by embedding a perl(1) interpreter into slapd(8). Any perl database section of the configuration file
slapd.conf(5) must then specify what Perl module to use. Slapd then creates a new Perl object that handles all the requests for that par-
ticular instance of the backend.
You will need to create a method for each one of the following actions:
* new # creates a new object,
* search # performs the ldap search,
* compare # does a compare,
* modify # modifies an entry,
* add # adds an entry to backend,
* modrdn # modifies an entry's rdn,
* delete # deletes an ldap entry,
* config # process unknown config file lines,
* init # called after backend is initialized.
Unless otherwise specified, the methods return the result code which will be returned to the client. Unimplemented actions can just return
unwillingToPerform (53).
new This method is called when the configuration file encounters a perlmod line. The module in that line is then effectively `use'd
into the perl interpreter, then the new method is called to create a new object. Note that multiple instances of that object may be
instantiated, as with any perl object. The new method receives the class name as argument.
search This method is called when a search request comes from a client. It arguments are as follows:
* object reference
* base DN
* scope
* alias deferencing policy
* size limit
* time limit
* filter string
* attributes only flag (1 for yes)
* list of attributes to return (may be empty)
Return value: (resultcode, ldif-entry, ldif-entry, ...)
compare
This method is called when a compare request comes from a client. Its arguments are as follows.
* object reference
* dn
* attribute assertion string
modify This method is called when a modify request comes from a client. Its arguments are as follows.
* object reference
* dn
* a list formatted as follows
({ "ADD" | "DELETE" | "REPLACE" },
attributetype, value...)...
add This method is called when a add request comes from a client. Its arguments are as follows.
* object reference
* entry in string format
modrdn This method is called when a modrdn request comes from a client. Its arguments are as follows.
* object reference
* dn
* new rdn
* delete old dn flag (1 means yes)
delete This method is called when a delete request comes from a client. Its arguments are as follows.
* object reference
* dn
config This method is called with unknown slapd.conf(5) configuration file lines. Its arguments are as follows.
* object reference
* array of arguments on line
Return value: nonzero if this is not a valid option.
init This method is called after backend is initialized. Its argument is as follows.
* object reference
Return value: nonzero if initialization failed.
CONFIGURATION
These slapd.conf options apply to the PERL backend database. That is, they must follow a "database perl" line and come before any subse-
quent "backend" or "database" lines. Other database options are described in the slapd.conf(5) manual page.
perlModulePath /path/to/libs
Add the path to the @INC variable.
perlModule ModName
`Use' the module name ModName from ModName.pm
filterSearchResults
Search results are candidates that need to be filtered (with the filter in the search request), rather than search results to be
returned directly to the client.
EXAMPLE
There is an example Perl module `SampleLDAP' in the slapd/back-perl/ direcetory in the OpenLDAP source tree.
WARNING
The interface of this backend to the perl module MAY change. Any suggestions would greatly be appreciated.
FILES
/etc/openldap/slapd.conf
default slapd configuration file
SEE ALSO
slapd.conf(5), slapd(8), perl(1).
OpenLDAP 2.1.X RELEASEDATE SLAPD-PERL(5)