[GRASS5] G_string_replace ()?

Markus Neteler neteler at itc.it
Thu Mar 11 02:55:26 EST 2004


On Wed, Mar 10, 2004 at 05:05:54PM +0100, Thierry Laronde wrote:
> FWIW, for string manipulations (and for OSes not supporting awk just
> provide an already "digest" version) simply use:
> 
> cat old_file | awk 'BEGIN { ORS="<br>";} {print;}' > new_file


Thierry,

thanks for the hint but I need to implement a C solution
in lib/gis/parser.c.

Markus
 
> Cheers.
> 
> On Wed, Mar 10, 2004 at 03:24:07PM +0100, Markus Neteler wrote:
> > Dear developers,
> > 
> > to enhance the HTML file creation in 5.7, I need
> > a function which replaces a string with another
> > string in a buffer. Something like
> > 
> > lib/gis/strings.c
> > char * G_strchg(char* bug, char character, char new) {
> >  /* replace all occurencies of "character" in string(bug) with
> >   * "new", returns new string */
> > 
> > but which generally does:
> >  G_string_replace (buffer, oldstring, newstring);
> > 
> > Example: I have to replace replace:
> >  G_string_replace (opt->options, '\n', '<br>');
> > 
> > Is there anyone willing/able to provide such function?
> > 
> > Thanks in advance,
> > 
> >  Markus
> > 
> > _______________________________________________
> > grass5 mailing list
> > grass5 at grass.itc.it
> > http://grass.itc.it/mailman/listinfo/grass5
> 
> -- 
> Thierry Laronde (Alceste) <tlaronde at polynum.org>
> Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C
> 
> _______________________________________________
> grass5 mailing list
> grass5 at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5




More information about the grass-dev mailing list