09-22-2007
YEs, their might be multiple occurences of "the" in a file.And I want the starting postion of all.But the word("the") will occur only once in a line.
For example:
asdshdjsh the--11
sdahsdhaskj the --13
aksjdhashahskshjjsdfjd the--24
Thank you!!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need a script for...
how to find a position of column data and print some string in the next line and same position
position should find based on *HEADER8* in text
for ex: ord123 abs 123 987HEADER89 test234
ord124 abc 124 987HEADER88 test235
... (1 Reply)
Discussion started by: naveenkcl
1 Replies
2. Shell Programming and Scripting
Hi,
I have a file named "Test_2008_01_21"
The file contains a string "manual" that occurs many times in the file
How can i find the positions of the string "manual" in the file
Ex: if the string " manual " occurs three times in the file. i want to replace the second occurance of string... (6 Replies)
Discussion started by: bab123
6 Replies
3. Shell Programming and Scripting
Hi All,
My requisite is to search for the string "0108"(which is the year and has come in the wrong year format) in a particular column say 4th column in a tab delimited file and then replace it with 2008(the correct year format) in the same position where 0108 was found..The issue is the last... (15 Replies)
Discussion started by: ganesh_248
15 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
My requisite is to search for the string "0108"(which is the year and has come in the wrong year format) in a particular column say 4th column in a tab delimited file and then replace it with 2008(the correct year format) in the same position where 0108 was found in the same file..The... (27 Replies)
Discussion started by: ganesh_248
27 Replies
5. UNIX for Dummies Questions & Answers
Hi
I am looking for a particular string in a file.If the string exists, then I want to replace another string with some other text.Once replaced, search for the same text after that character position in the file. :wall:
E.g: Actual File content:
Hello
Name: Nitin Raj
Welcome to Unix... (4 Replies)
Discussion started by: dashing201
4 Replies
6. Shell Programming and Scripting
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies
7. Shell Programming and Scripting
I am having a text file which is having more than 200 lines.
EX:
001010122 12000 BIB 12000 11200 1200003
001010122 2000 AND 12000 11200 1200003
001010122 12000 KVB 12000 11200 1200003
In the above file i want to search for string KVB and add/replace... (1 Reply)
Discussion started by: suryanarayana
1 Replies
8. Shell Programming and Scripting
trying to grep for a string at a certain position in a commands output in order to use it as a variable:
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.2.1 0.0.0.0 UG 0 0 0 wlan1... (4 Replies)
Discussion started by: 3therk1ll
4 Replies
9. Shell Programming and Scripting
Hi,
I have a file with multiple lines(fixed width dat file). I want to search for '02' in the positions 45-46 and if available, in that lines, I need to replace value in position 359 with blank. As I am new to unix, I am not able to figure out how to do this. Can you please help me to achieve... (9 Replies)
Discussion started by: Pradhikshan
9 Replies
10. Shell Programming and Scripting
Hello guys, would you please help me with this?
this is the line inside a file:
first line Something Today YYDDPPSVXIPYYY0XXXOFFS00000000000?
I'd like to find the position of string XXX from string PYYY
In the example above
XXX starts from 6th position from PYYY
desired... (4 Replies)
Discussion started by: netrom
4 Replies
LEARN ABOUT DEBIAN
data::random::wordlist
Data::Random::WordList(3pm) User Contributed Perl Documentation Data::Random::WordList(3pm)
NAME
Data::Random::WordList - Perl module to get random words from a word list
SYNOPSIS
use Data::Random::WordList;
my $wl = new Data::Random::WordList( wordlist => '/usr/share/dict/words' );
my @rand_words = $wl->get_words(10);
$wl->close();
DESCRIPTION
Data::Random::WordList is a module that manages a file containing a list of words.
The module expects each line of the word list file to contain only one word. It could thus be easily used to select random lines from a
file, but for coherency's sake, I'll keep referring to each line as a word.
The module uses a persistent filehandle so that there isn't a lot of overhead every time you want to fetch a list of random words.
However, it's much more efficient to grab multiple words at a time than it is to fetch one word at a time multiple times.
The module also refrains from reading the whole file into memory, so it can be safer to use with larger files.
METHODS
new()
Returns a reference to a new Data::Random::WordList object. Use the "wordlist" param to initialize the object:
o wordlist - the path to the wordlist file. If a path isn't supplied, the wordlist distributed with this module is used.
get_words([NUM])
NUM contains the number of words you want from the wordlist. NUM defaults to 1 if it's not specified. get_words() dies if NUM is greater
than the number of words in the wordlist. This function returns an array or an array reference depending on the context in which it's
called.
close()
Closes the filehandle associated with the word list. It's good practice to do this every time you're done with the word list.
VERSION
0.07
AUTHOR
Originally written by: Adekunle Olonoh
Currently maintained by: Buddy Burden (barefoot@cpan.org), starting with version 0.06
COPYRIGHT
Copyright (c) 2000-2011 Adekunle Olonoh. All rights reserved. This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
SEE ALSO
Data::Random
perl v5.14.2 2012-06-04 Data::Random::WordList(3pm)