I had written a pgm, loading numeric data into an array. It worked great. Then, I tried to load data from a file, in which one of the elements has a space and now I'm having a problem. It seems like once the space is encountered, the rest of the data is not loaded. The element with the space is...
AndyBo,
Thanks, I didn't think I ever saw a 'goto' label in Unix shell, but sometimes the 'former' Cobol programmer in me comes out and I can't remember where I saw what!
I will suggest to him altering the shell to use functions.
Debi :-)
A co-worker of mine has a very large Unix shell script that was coded without the use of functions :(, not something I would do, but....
Is there a label in Unix, say like the goto stmt where he can just branch to another section of code in leu of re-writting it using functions?
I have checked...
Thanks Russ, Your response was very helpful.
I had started the pgm using fgets, but saw that the standard here was fread. But for my case, the files are fixed length ascii files. So this works!
I have a 'master' file, in this example 20 bytes long. The data looks like this:
11111TestOne0005.10
22222TestTwo0006.50
The key in this file starts in col 1 to 12, so 11111TestOne and 22222TestTwo are the keys. (In reality, this file will be larger approx. 7,000 recs at 450 bytes long)
I have...
I am working on a C project, to which I have little
experience. I am starting with a simple program - read input, load into an array and then write out a new file.
The problem is either I'm not loading of the array properly or I'm not writing out to the file the right way. I say this because...
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.