I have a binary file (actually it's in memory)
which saved character as a reverse-byte order which means
ABCDEFGX stores as BADCFEXG
is there some function like strstr() in c standard library to match
substring "BCDE" (but in reverse-order for) how could I do it?
while I try to solve my problem myself,I found
ABCDEFGX may stores AYCBEDGFRX in the binary file, Y,R are some
characters I don't care.
this maybe called NUXI problem or something like that I try to google
it out but can't find anything useful. 6 1679
timmu wrote: I have a binary file (actually it's in memory) which saved character as a reverse-byte order which means
ABCDEFGX stores as BADCFEXG
is there some function like strstr() in c standard library to match substring "BCDE" (but in reverse-order for) how could I do it?
I'm not certain I understand your problem...if you
are trying to match "this string.", why don't
you just search for "htsis rtni.g"?
well, my problem is
"this string" may be presented like
"htsis rtni.g" or "tXih srtnig" where X character is something I don't
need.
actually I need to parse some strings like "arg1=On,arg2=False"
which "arg2" may present like "ra2gF=" or "a,gr=2"
On 2006-05-18, Bill Pursell <bi**********@gmail.com> wrote: timmu wrote: I have a binary file (actually it's in memory) which saved character as a reverse-byte order which means
ABCDEFGX stores as BADCFEXG
is there some function like strstr() in c standard library to match substring "BCDE" (but in reverse-order for) how could I do it?
I'm not certain I understand your problem...if you are trying to match "this string.", why don't you just search for "htsis rtni.g"?
Because he could be looking for "t?ih stsirgn?." instead?
On Thu, 18 May 2006 09:38:00 -0700, timmu wrote: I have a binary file (actually it's in memory) which saved character as a reverse-byte order which means
ABCDEFGX stores as BADCFEXG
is there some function like strstr() in c standard library to match substring "BCDE" (but in reverse-order for) how could I do it?
while I try to solve my problem myself,I found ABCDEFGX may stores AYCBEDGFRX in the binary file, Y,R are some characters I don't care.
this maybe called NUXI problem or something like that I try to google it out but can't find anything useful.
The usual rule round here is to post actual (minimal) code the exhibits the
problem.
For example, cut down the program that "may store" ABCDEFGX as AYCBEDGRX,
post it here and you will be flooded with helpful replies.
--
Ben.
timmu wrote: I have a binary file (actually it's in memory) which saved character as a reverse-byte order which means
ABCDEFGX stores as BADCFEXG
Actually it stored binary WORD values in little endian byte order. (at
least I think that's it. I sometimes confuse little endian and big
endian.) is there some function like strstr() in c standard library to match substring "BCDE" (but in reverse-order for) how could I do it?
Why not just write a simple filter program or routine to reverse the
bytes? while I try to solve my problem myself,I found ABCDEFGX may stores AYCBEDGFRX in the binary file, Y,R are some characters I don't care.
this maybe called NUXI problem or something like that I try to google it out but can't find anything useful.
try looking for little endian and big endian
ed
"timmu" <ti****@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com... I have a binary file (actually it's in memory) which saved character as a reverse-byte order which means
ABCDEFGX stores as BADCFEXG
is there some function like strstr() in c standard library to match substring "BCDE" (but in reverse-order for) how could I do it?
while I try to solve my problem myself,I found ABCDEFGX may stores AYCBEDGFRX in the binary file, Y,R are some characters I don't care.
this maybe called NUXI problem or something like that I try to google it out but can't find anything useful.
The best solution is to write a function
unscramble(char *littleendian)
{
}
This is trivial to implement. The only snag is that you need to know the
phase - whether you start in the middle of 16-bit block or not.
-- www.personal.leeds.ac.uk/~bgy1mm This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Martin Robins |
last post by:
I am trying to parse a string that is similar in form to an OLEDB connection string using regular expressions; in principle it is working, but certain character combinations in the string being...
|
by: Old Wolf |
last post by:
Hi all. G++ fails to compile the following:
#include <string>
int main()
{
std::string foo("abc=123");
std::string::const_iterator delimiter
= std::find(foo.begin(), foo.end(), '=');
|
by: Paul |
last post by:
hi, there,
for example,
char *mystr="##this is##a examp#le";
I want to replace all the "##" in mystr with "****". How can I do this?
I checked all the string functions in C, but did not...
|
by: olaufr |
last post by:
Hi,
I'd need to perform simple pattern matching within a string using a
list of possible patterns. For example, I want to know if the substring
starting at position n matches any of the string I...
|
by: Martin Jørgensen |
last post by:
Hello again,
Sorry to bother but I guess my C++ book isn't very good since it
obviously contains errors so the program code doesn't work with g++.
However I don't understand what the problem...
|
by: laura |
last post by:
Hi,
I'm looking for the algorithm which does the lowest number of
comparison for the string matching problem (in the worst case).
I know that the complexity is liniar in the length of the...
|
by: Morten71 |
last post by:
I have a strange problem.
I have a local string() var I populate this way:
clmns() As String = {"InvoiceNo", "InvoiceDate"}
When I call:
Array.IndexOf(clmns,"InvoiceDate") I get 0 (zero) as...
|
by: |
last post by:
I am interested in scanning web pages for content of interest, and then
auto-classifying that content. I have tables of metadata that I can use for
the classification, e.g. : "John P. Jones" "Jane...
|
by: tech |
last post by:
Hi, I need a function to specify a match pattern including using
wildcard characters as below
to find chars in a std::string.
The match pattern can contain the wildcard characters "*" and "?",...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |