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@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@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
>>
>>        [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>

	[[alternative HTML version deleted]]

