Received: by 10.151.112.12 with SMTP id p12mr852082ybm.23.1228092126131; Sun, 30 Nov 2008 16:42:06 -0800 (PST)Date: Sun, 30 Nov 2008 16:42:06 -0800 (PST)X-IP: 98.148.200.75User-Agent: G2/1.0X-Google-Token: Twnm0gwAAADxx5QEfa7tUigJfrHU3mf4X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.4) Gecko/2008111318 Ubuntu/8.04 (hardy) Firefox/3.0.4,gzip(gfe),gzip(gfe)Message-ID: <72ecf372-4c81-42d1-a169-851ba4ce7758@d36g2000prf.googlegroups.com>Subject: format for reading a binary file.From: butch <elmer_fwd>To: “Kdb+ Personal Developers” X-Google-Approved: charlie@kx.com via web at 2008-12-01 04:11:45I know that::f.bin 1: 0x41424344454647484950will create a binary fileI know that:("c c";1 1 1 1 1 1 1 1 1 1)1:
f.binthat using " “, I will skip 8 elements of the record and will displayonly the first and the last of the 10 ascii characters.I have a binary file that has records consisting of a time-stamp,followed by 2000 floats.As an example, I want to skip the first 1995 float fields. Using the” " to indicate skipping float ffields is not feisable.Any suggestions?</elmer_fwd>
X-Mailer: Apple Mail (2.929.2)why is it not feasible?/ generate test file, timestamp + 2000 random floatsq):f.bin 1:(-8#-8!.z.z),(-8*2000)#-8!2000?100.0
:f.bin/ read all of test fileq)(“z”,2000#“f”;2001#8)1:f.bin2008.12.01T04:43:40.09293.8112313.3560811.55152.../ or just skip the first 1995 float fieldsq)("z",(1995#" "),5#"f";2001#8)1:
f.bin2008.12.01T04:43:40.09299.697193.2468484.6175624.7906688.12264Kind regards,CharlieOn Dec 1, 2008, at 1:42 AM, butch wrote:>> I know that:>> :f.bin 1: 0x41424344454647484950\>\> will create a binary file\>\> I know that:\>\> ("c c";1 1 1 1 1 1 1 1 1 1)1:
f.bin>> that using " ", I will skip 8 elements of the record and will display> only the first and the last of the 10 ascii characters.>> I have a binary file that has records consisting of a time-stamp,> followed by 2000 floats.>> As an example, I want to skip the first 1995 float fields. Using the> " " to indicate skipping float ffields is not feisable.>> Any suggestions?>>> >
Nice…I have a file that consists of 100,000 records each of which containsa timestampat the beginning of each record with 2000 floats.Would I be correct in assuming that I could create an float array thatis 100,000 by 2,001and then process the contents of the array?How about creating an array that is 100,000 records by 1 timestamp + 2floats.I don’t really need all the data from the file, just the timestampsand a few of the floats.thanksOn Nov 30, 8:47?pm, “Charles Skelton,Kx” <char…> wrote:> why is it not feasible?>> / generate test file, timestamp + 2000 random floats> q):f.bin 1:(-8#-8!.z.z),(-8*2000)#-8!2000?100.0>
:f.bin>> / read all of test file> q)(“z”,2000#“f”;2001#8)1:f.bin> 2008.12.01T04:43:40.092> 93.81123> 13.35608> 11.55152> ...>> / or just skip the first 1995 float fields> q)("z",(1995#" "),5#"f";2001#8)1:
f.bin> 2008.12.01T04:43:40.092> 99.6971> 93.24684> 84.61756> 24.79066> 88.12264>> Kind regards,> Charlie>> On Dec 1, 2008, at 1:42 AM, butch wrote:>>>> > I know that:>> > :f.bin 1: 0x41424344454647484950>> > will create a binary file>> > I know that:>> > ("c ? ? ? ?c";1 1 1 1 1 1 1 1 1 1)1:
f.bin>> > that using " ", I will skip 8 elements of the record and will display> > only the first and the last of the 10 ascii characters.>> > I have a binary file that has records consisting of a time-stamp,> > followed by 2000 floats.>> > As an example, I want to skip the first 1995 float fields. ?Using the> > " " to indicate skipping float ffields is not feisable.>> > Any suggestions?</char…>