I tried to solve this but the result gives me all zeros for one file. I failed to do for all 500 files.
I have some 500 files with the extension .dat I have another set of files; 500 in number with extension .dic I created these .dic files by using
from the actual .dat files.
This is what I mean:
For example, my 1.dat looks like this:
After I use
I get 1.dic like this:
I did the same for all 500 files. That is create .dic from .dat
I have another set of files with extension .fil These files contain numbers for the words in stored in .dic Hence, for 1.dic my 1.fil looks like this:
Now in all, this is the scenario:
I) 1.dat the main file with the complete set of words.
II) 1.dic the file created by
on 1.dat
III) 1.fil the file containing numbers and these numbers correspond to some values of the words stored in 1.dic, this means for every word in 1.dic, there is some value stored in 1.fil
The task which I am trying to accomplish:
I want to look in each .dic file, then get the words line by line one at a time, then get the value corresponding to that word from .fil file and then search the .dat file for the position of that word in the .dat file and store that number against the position in some separate file, lets name it 1.num.
Taking above case here's the output for 1.num:
One can notice that I just looked at the 1.dic got the word, got the corresponding value from 1.fil, then searched the 1.dat and placed that number against the position of that word in 1.num. I have to do this for some 500 files of the same types that is .dic, .dat and .fil and create 500 .num files
This is what I have done so far:
I am using Linux with BASH. Any help appreciated.
Hello
I have an file with this content
--------------------------------------------
timer
one
timer
two
timer
three
timer
four
timer
five
timer
six
timer
seven
-------------------------------------------
And I want the following output.... (4 Replies)
Hi all,
There are several lines in my file as
a=123,b=dene,c=2312,d=234234,g=vxcvxcv,h=44
a=3,b=dene,c=22,d=23422342334,g=vxcvxcv,h=4
a=123,b=dene,c=2312,d=234234,g=vxcvxcv,h=678
I take values with this command
awk -F '' '{print $1,$2,$3}' a.txt
I want to put values to a fix position... (6 Replies)
Hi All
I need help
am having a source file as below
emp
dept
class
subclass
region
country
division
first i need to get line count and i need to divide by 3 it is an parameter passing value
number of lines 7 (8 Replies)
Hi, consider a file which has data such as
"random text",912345,"54","finish"
"random text",9991236745,"9954","finish"
I want to replace the numbers that don't have double quotes around them with ones that do; so the output should be
"random text","912345","54","finish"
"random... (4 Replies)
Hi All,
I have a file which looks like this:
abc 1
abc 2
abc 3
abc 4
abc 5
bcd 1
bcd 3
bcd 3
bcd 5
cde 7
This file is just a miniature version of what I really have. Original file is some 1 million lines long.
I have tried to come up with the code for what I wish to accomplish... (1 Reply)
Hi. I have a file containing words and numbers associated with them as follows -
c 2
b 5
c 5
b 6
a 10
b 16
c 18
a 19
b 21
c 27
a 28
b 33
a 76
a 115
c 199
c 251
a 567
a 1909 (4 Replies)
Hi,
Sorry in advance for propably a silly question, but I am a bit lost.
On some of the linux job flow I have the following check:
if ($file != 1500) then
echo ERROR
It works ok, all times $file is not equal to 1500 I have the error message.
I try to do something similar... (7 Replies)
Hi,
I have to write a shell script that converts numbers in to words
below is what i wrote.My script is not running.
-----------------------------------
echo -n "Enter number : "
read n
len= echo $n | wc -c
echo " number in words : "
for ( i=1; i<len; i++ )
do
num=echo $n... (5 Replies)
Hi all,
Please some help over here. I have a Sales.txt file containing info in blocks for
every sold product in the pattern showed below (only for 2 products).
NEW BLOCK
SALE DATA
PRODUCT SERIAL
79833269999 146701011945004
.Some other data
.Some... (17 Replies)
Hi,
If i give a number say "1234" the output of mysql query should be:
one thousand and twenty four
How to write mysql query for this?
With regards
Vanitha (5 Replies)