Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
- To: "MLUG Members" <EMAIL:PROTECTED>
- Subject: Re: [MLUG] String manipulation in C
- From: "Mark Rages" <EMAIL:PROTECTED>
- Date: Sun, 1 Jul 2007 23:16:23 -0500
- Delivery-date: Sun, 01 Jul 2007 23:16:57 -0500
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=SSeAY+Sx0Z8D3oNsIGZUAXmzxvUzQg+gi7MLrG9muhsZ1vqr+tJmqyTYjjWmYW/u+n12e0yrYiCP+WPOiW6AaHNs43DlwVzSpQIDXPP0zDgNA8/l9IaaM1wetV2czOZqkKxh6UH2cImO5gNUSymqafhlBmazNm30BR4bEOhfUlM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JRiylhtsytPFZmyZSMBSOnUfCBBiTj6/rxBVASvTuJYmQRIzyd+dlagnlKeP9mYlAh4ijRfMHK8RjlG3v8hBdeWH7xXaO3paZnB1toCGnTAipwRec6ShaMsvJmoGhBMD5XKV4lsm80vWjpGuPmExdH4qN9jABj6ZKbjtrzYor0k=
- Envelope-to: EMAIL:PROTECTED
- In-reply-to: <EMAIL:PROTECTED>
- References: <EMAIL:PROTECTED> <EMAIL:PROTECTED> <EMAIL:PROTECTED> <EMAIL:PROTECTED> <EMAIL:PROTECTED> <EMAIL:PROTECTED>
- Reply-to: MLUG Members <EMAIL:PROTECTED>
- Sender: EMAIL:PROTECTED
On 7/1/07, Jack Smith <EMAIL:PROTECTED> wrote:
The matches will need to be put in a MATLAB data frame first and then a
MySQL database later. Outputting data in columns would work as I could
read the columns in later to make the data frame.
I know that grep will find the expression as many times as it appears in
the string searched. But I need it to find how many characters the start
of the match is from the start of the string. The best that I see can
come from grep is number of letters that the first character in the line
the match is in is from the start (the byte offset.) But I need the
actual distance from start -> match.
Jack
OK, if you wanna try C:
#include <string.h>
void print_offset_matches(char *needle, char *haystack) {
char *begin=haystack;
while (haystack=strstr(haystack,needle))
printf("%d\n",haystack-begin);
}
--
Mark Rages, Engineer
Midwest Telecine LLC
EMAIL:PROTECTED
_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members