[R] DBS to R

Sarah Goslee sarah.goslee at gmail.com
Sun Sep 11 02:46:24 CEST 2011


I'm assuming you don't have access to the original program and source, but
do you know what it is, and what version? (If you do have access to the
original, then just export it in a different format.) The identity of
the program
would definitely help in reverse-engineering the format or finding a way
to convert it.

In your example, are you really getting "XX" for all entries, or are you
obfuscating the data?

Sarah

On Sat, Sep 10, 2011 at 7:54 PM, Ben qant <ccquant at gmail.com> wrote:
> Recap: trying to get a 'dbs' extension file into R.
>
> I tried most of the functions in the 'forgein' package. Nothing there
> worked. Scan seemed to do the best. See below... I've tired using readBin()
> for hours and I haven't extracted the value I want, price.
>
> This example is a tiny sample dbs file that should have ticker, fye month,
> company, split fact, and price, where ticker = 'IBM'; fye month='N/A';
> Company='---------------'; split fact= '2.00' (5/27/99), '2.00' (5/28/97),
> and 'N/A'; Price='165.25' (9/02/11). As you might have guessed this is stock
> time series data on one stock (IBM). See the end of this email. I can see
> the ticker and Company, but nothing else seems reveal itself.
>
>  to.read =scan("C:\\some_path\\one_test2.dbs","rb")
>
>  to.read[1:600]
>  [1] "VER"          "3.7"          "\b"           "\002\017\b\b"
> "*"            "TICKER"       "NZCIFYE"      "FYE"          "MONTH"
> "NZCICNAME"    "COMPANY"      "NZCISPLITS"   "SPLIT"
>  [14] "FACTNZP"      "3"            "PRICE"        "XX"
> "XX"           "XX"           "XX"           "XX"           "XX"
> "XX"           "XX"           "XX"           "XX"
>  [27] "XX"           "XX"           "XX"           "XX"
> "XX"           "XX"           "XX"           "XX"           "XX"
> "XX"           "XX"           "XX"           "XX"
>  [40] "XX"           "XX"           "XX"           "XX"
> "XX"           "XX"           "XX"           "XX"           "XX"
> "XX"           "XX"           "XX"           "XX"
>
>> to.read[600:length(to.read)]
>  [1] "XX"                            "XX"
> "XX"                            "XX"
> "XX"                            "XX"
>  [7] "XX"                            "XX"
> "XX"                            "XX"
> "XX"                            "XX"
>  [13] "XX"                            "XX"
> "XX"                            "XX"
> "XX"                            "XX"
>
> .......cont'd......
>
> [565] ""                              ""
> ""                              ""
> ""                              ""
> [571] ""                              ""
> ""                              ""
> ""                              ""
> [577] ""                              ""
> ""                              ""
> ""                              ""
> [583] ""                              ""
> ""                              ""
> ""                              ""
> [589] ""                              ""
> ""                              ""
> ""                              ""
> [595] ""                              ""
> ""                              ""
> ""                              ""
> [601] ""                              ""
> ""                              ""
> ""                              ""
> [607] "IBM       ñØ---------------Jq" "@qn"
> "@"                             "À\035tÉ"
>
>
> Any ideas or suggestions? I'm thinking readBin() is the way to go but all I
> get are meaningless numbers and the character strings you see above.
> However, I think scan() with the "rb" is doing a similar thing to readBin().
> (If you are curious, when using readBin() I'm using integer(), n = 100000,
> size = 8 (but I've tried many others), and endian='little".)
>
> Thank you so much for your help!
>
> Ben
>
> On Sat, Sep 10, 2011 at 1:50 PM, R. Michael Weylandt <
> michael.weylandt at gmail.com> wrote:
>
>> No experience with dbs files, but the foreign package might be able to help
>> you out.
>>
>> Michael
>>
>> On Sat, Sep 10, 2011 at 2:44 PM, Ben qant <ccquant at gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I have a bunch of data files all with "dbs" file extensions. They are
>>> generated via a SQL query from another program and source. Does anyone
>>> know
>>> (or have ideas) how to get the data from a dbs file type into R (or into
>>> some other format that can imported to R)? I've searched online for 4
>>> hours
>>> now...
>>>
>>> Thanks!
>>>
>>> Ben
>>

-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list