![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hi Art On Dec 16, 9:40 pm, art <artma... (AT) triad (DOT) rr.com> wrote: In a D3/Linux environment, I'm trying to figure out how to access a 300mb+ sized linux record. Everything I try yields a runaway process error. I know the runaway process limit can be set higher with the set-runaway-limit command, but I don't know how high I'd have to go with this command, and whether I would really want it that big for normal operations. If anybody has any tips or tricks to access a very large linux record from D3, I'd like to hear them. If you're talking about accessing the contents of a file in the linux filesystem, from within D3, then take a look at the %OPEN and %READ commands in the basic manual. Even with a basic program using those commands, you'll probably still only want to process the file in chunks, as opposed to all 300mb in one go ![]() Pete |
#4
| |||
| |||
|
|
In a D3/Linux environment, I'm trying to figure out how to access a 300mb+ sized linux record. Everything I try yields a runaway process error. I know the runaway process limit can be set higher with the set-runaway-limit command, but I don't know how high I'd have to go with this command, and whether I would really want it that big for normal operations. If anybody has any tips or tricks to access a very large linux record from D3, I'd like to hear them. Art |
LINE+1):","
LINE+500):"p"
LINE+501):"q' ":FPATH
LINE+1):" && NR <= "
LINE+500)

#5
| |||
| |||
|
|
art wrote: In a D3/Linux environment, I'm trying to figure out how to access a 300mb+ sized linux record. Everything I try yields a runaway process error. I know the runaway process limit can be set higher with the set-runaway-limit command, but I don't know how high I'd have to go with this command, and whether I would really want it that big for normal operations. If anybody has any tips or tricks to access a very large linux record from D3, I'd like to hear them. Art If you want tricks, here are three in decreasing order of performance. I haven't any of them, so I'm curious how they work. ;b In short, skip the %functions approach and try the code below which makes use of commands in the host OS. This is for *nix only though you can find or write code that does the same functions in Windows. First try: Generate a command line this: sed -n '1,100p;101q' filename FPATH = "/tmp/myfile" ; * change as appropriate LINE=0 LOOP CMD = "!" ; * change for your platform to "! ", "SH -C", etc CMD = CMD:"sed -n '" LINE+1):"," LINE+500):"p"CMD = CMD:";" LINE+501):"q' ":FPATHEXECUTE CMD CAPTURING BLOCK UNTIL BLOCK = "" DO ; * please check this!! GOSUB PROCESS.BLOCK LINE = LINE + 500 REPEAT * ... At the UNTIL/DO, I don't know what to expect, either an error that there aren't as many lines as we expect, or my guess is null. (I just wrote it, I didn't try it. Welcome to OSS.) Be careful about LF delimiters. Also, the syntax for sed may be different for GNU, AIX or HP, etc. Second try: You could use awk, or a combination of head and tail, but sed is optimized for streams. Here is the awk version of the above sed command. awk 'NR >= 1 && NR <= 3' filename CMD = "!" CMD = CMD:"awk ' NR >= " LINE+1):" && NR <= " LINE+500)CMD = CMD:" ' ":FPATH Third try: Here is the heads n tails version, though it's bound to be much less efficient as the file gets larger: FPATH = "/tmp/myfile" ; * change as appropriate FOR LINE = 1 TO 9999999 STEP 100 ; * sloppy, don't care. ![]() CMD = "!" ; * change for your platform to "! ", "SH -C", etc CMD = CMD:"head -":LINE:" ":FPATH:" | tail -100" EXECUTE CMD CAPTURING BLOCK GOSUB PROCESS.BLOCK NEXT N * ... This gets lines 1-100, then gets the last 100 lines. Easy enuf. Then it gets lines 1-200, and takes off the last 100 lines, which is 101-200. Your system may groan in agony as it gets deeper into the file. I hope that's enough tricks for one day. ![]() T |
#6
| |||
| |||
|
|
If anybody has any tips or tricks to access a very large linux record from D3, I'd like to hear them. Art You could create a directory /tmp/bob |
#7
| |||
| |||
|
|
and issue one cd /tmp/bob ; cat /tmp/myfile | split -1000 command to populate it with a gazillion small files. |
#8
| |||
| |||
|
|
Frank Winans wrote: {I like split} {I like split, too.} |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |