Hi guys,

Ikegami i already use the three last solutions that you said
and the regular expression is the best one...


Now about the C solution the problem is that i dont know very well
this language unfortunately and i dont have time to learn it..


I believe if i will work the bit string without unpack it
will be the fastest solution ..
Can you give me some help with the mask and vec functions???

About what i want to do with the bit string...

In the string i save possitive compressed integers and to
decode them i read from the start the string how many
1s exist until i will find the first 0 (lets assume N ones).Then the compressed
number is (in binary) the next N bits after the 0, plus an
additional bit in the begining of the next N digits. Like this way for the next bits..


For example lets assume that i compressed in the below bit string just one number...

BitString: 1110,001
N=3 (the first 1s until the first 0)
The next N digits are : 001
So the number in binary is 1001 by add one bit in the start of the next N bits...


Can you tell me an optimal way to decode this bit string...??

Thanks Guys!!!

Mimis

In reply to Re: Read Bit String...!!! by MimisIVI
in thread Read Bit String...!!! by MimisIVI

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.