One last (and probably all too obvious) question. In:
while ( len )
{
random = int( rand() * len ) + 1
scrambled[++i] = sample[random]
sample[random] = sample[len]
len--
}
why do you need the following line?
sample[random] = sample[len]
If anyone could please...
Hi guys! I'm new to Linux so excuse me if the answer to this should turn out to be too obvious. I am working with numbered files eg train1.txt, train2.txt etc. Is there a way to execute a command on these files and make the number variable? What I mean is something like:
for (x=1;x<=10;x++) do...
One last question, guys and gals. I've almost got this program finished. As already mentioned above it's supposed to first randomize the data and then produce 10 different files each containing a different 10% of the randomized data. Up to this point the program works. But then it also has to...
Thank you very much, everybody.
PHV, I think that is exactly what I needed! :) Always learning a little bit more by looking at somebody else's take on a problem. Thanks!
Hi guys!
I'm working on a little program to randomly shuffle my data (for use in tenfold cross-validation experiments). My data file has 4332 records, so I thought I'd first fill an array with numbers from 1 to 4332 (each number being in there once) and then later use these numbers as indices...
Love the signature :) Hehe
Thanks, but you were completely right: the original code was indeed too mixed up. I cleaned it all up and figured it out myself. Apart from throwing out and rearranging a lot of code, the simple answer was:
r=substr(b[x],(y+z),2)
Been looking way too long for...
Hi,
Been working on a program that among others should be able to split up verbs in a onset-nucleus-coda structure (with the help of this forum, thanks guys). Almost finished now, except for a couple of bugs.
Sample code:
BEGIN { FS="," ; fs="[" ; d="=" }
{
printf $1 FS $2 FS $3
n =...
Thank you all for your replies. Please excuse me for taking this long to reply myself.
Ygor, I tried your solution but all I got was
abide,=,=,=,=,=,=,=,=,=
abolish,=,=,=,=,=,=,=,=,=
accomodate,=,=,=,=,=,=,=,=,=
I'm using GNU Awk 3.0.3 under WinXP. Any ideas?
I have an input file with a lemma, the cvc structure of that lemma, and the pronunciation of that lemma, eg
abide,[V][CVVC],[@][baId]
abolish,[V][CV][CVC],[@][bO][lIS]
What I would like to do is convert this to an output that gives me the original lemma together with an onset-nucleus-coda...
Let me first give an example of what I would like to do:
I have an input file consisting of a number of records, each record consisting of 2 fields eg
list lIst
screen skri.n
I want to be able to shift the focus letter of the first field, along with its context (eg 3 letters to the right, 3...
I'm new to AWK, but I was wondering if any of you might be able to help me with this:
I want to be able to check whether the value of a certain field (the field is the same for all the records) is different from any of the field values in previous records. So e.g., every record has 4 fields...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.