10-31-2014
Thank you, Chubler! Any idea how I can print off the index value as well? Should I be using asorti instead of sort? I'd like my output to appear like the following example:
Index Word Count
1 the 247
2 a 215
3 to 201
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am a newbie in UNIX shell script and seeking help on this UNIX function. Please give me a hand. Thanks.
I have a large file. Named as 'MyFile'. It was tab-delmited. I am told to write a shell function that counts the number of occurrences of the ord “mysring” in the file 'MyFile'. (1 Reply)
Discussion started by: duke0001
1 Replies
2. Shell Programming and Scripting
I have a text (text.txt) and I would like to replace only the first 2 occurrences of a word (but I might need to replace more):
For example, if text is this:
CAR sweet head
hat red yellow
CAR book brown
tiger CAR cow CAR
CAR milk
I would like to replace the word "CAR" with word... (12 Replies)
Discussion started by: bingel
12 Replies
3. Homework & Coursework Questions
Assistance on work Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Files stored in ... (1 Reply)
Discussion started by: alindner
1 Replies
4. Shell Programming and Scripting
Hello,
I have an output from GDB with many entries that looks like this
0x00007ffff7dece94 39 in dl-fini.c
0x00007ffff7dece97 39 in dl-fini.c
0x00007ffff7ab356c 50 in exit.c
0x00007ffff7aed9db in _IO_cleanup () at genops.c:1022
115 in dl-fini.c
0x00007ffff7decf7b in _dl_sort_fini (l=0x0,... (6 Replies)
Discussion started by: ikke008
6 Replies
5. Shell Programming and Scripting
I am trying to count the occurrences of ALL words in a file. However, I want to exclude certain words: short words (i.e. <3 chars), and words contained in an blacklist file. There is also a desire to count words that are capitalized (e.g. proper names). I am not 100% sure where the line on... (5 Replies)
Discussion started by: Cronk
5 Replies
6. UNIX for Dummies Questions & Answers
Hi all, I have to do a script bash (for university) that counts all word occurrences in a specific web page.
anyone can help me?. Thanks :) (1 Reply)
Discussion started by: piacentero
1 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have two text files (1.txt and 2.txt).
2.txt contains two columns which are extracted from 1.txt using a simple if(condition) print.
I want to:
- count how many times the values contained in 2.txt appear in 1.txt
-if they appear just one time, I have to delete the entire row in... (5 Replies)
Discussion started by: Pintug
5 Replies
8. Shell Programming and Scripting
Hi Gurus,
I'm scratching my head over and over and couldn't find the the right way to compose this AWK properly - PLEASE HELP :confused:
Input:
c,d,e,CLICK
a,b,c,CLICK
a,b,c,CONV
c,d,e,CLICK
a,b,c,CLICK
a,b,c,CLICK
a,b,c,CONV
b,c,d,CLICK
c,d,e,CLICK
c,d,e,CLICK
b,c,d,CONV... (6 Replies)
Discussion started by: Royi
6 Replies
9. UNIX for Advanced & Expert Users
I was thinking something like this but it always gets rid of the file location.
grep -roh base. | wc -l
find . -type f -exec grep -o base {} \; | wc -l
Would this be a job for awk? Would I need to store the file locations in an array? (3 Replies)
Discussion started by: cokedude
3 Replies
10. UNIX for Beginners Questions & Answers
Hi Friends ,
I am having one problem as stated file .
Having an input CSV file as shown in the code
U_TOP_LOGIC/U_HPB2/U_HBRIDGE2/i_core/i_paddr_reg_2_/Q,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0... (4 Replies)
Discussion started by: kshitij
4 Replies
LEARN ABOUT DEBIAN
plucene::index::reader
Plucene::Index::Reader(3pm) User Contributed Perl Documentation Plucene::Index::Reader(3pm)
NAME
Plucene::Index::Reader - Abstract class for accessing an index
DESCRIPTION
IndexReader is an abstract class, providing an interface for accessing an index. Search of an index is done entirely through this abstract
interface, so that any subclass which implements it is searchable.
Concrete subclasses of IndexReader are usually constructed with a call to the static method "open".
For efficiency, in this API documents are often referred to via document numbers, non-negative integers which each name a unique document
in the index. These document numbers are ephemeral--they may change as documents are added to and deleted from an index. Clients should
thus not rely on a given document having the same number between sessions.
METHODS
new
my $reader = Plucene::Index::Reader->new($dir_name);
This will create a new Plucene::Index::Reader with the passed in directory.
open
# If there is only one segment
my Plucene::Index::SegmentReader $seg_read = $reader->open;
# If there are many segments
my Plucene::Index::SegmentsReader $seg_read = $reader->open;
Returns an IndexReader reading the index in the given Directory.
last_modified
my $last_modified = Plucene::Index::Reader->last_modified($directory);
index_exists
if (Plucene::Index::Reader->index_exists($directory)){ ... }
is_locked
if (Plucene::Index::Reader->is_locked($directory)){ ... }
delete
$reader->delete($doc);
delete_term
$reader->delete_term($term);
This will delete all the documents which contain the passed term.
close
$reader->close;
unlock
$reader->unlock($directory);
num_docs / max_doc / document / is_deleted / norms / terms / doc_freq / term_docs / term_positions / _do_delete / _do_close
These must be defined in a subclass
perl v5.12.4 2011-08-14 Plucene::Index::Reader(3pm)