Jump to content

Recommended Posts

Posted

hello, i have been trying to replace an automatically generated text from a html file so far this is what i have found

$fileopen = FileOpen("vol002.htm", 1)
$sNewText = StringRegExpReplace($fileopen, "[<!-- generated -->]", "this try")FileWrite($fileopen, $sNewText)
FileClose($fileopen)

i belive i have to rewrite all the document replacing <!-- generated --> to this try then use filewrite but i cant find how to do that

Posted

Could you provide a small sample of the input data and what the output data should be formatted to.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

  On 2/27/2013 at 6:03 PM, 'guinness said:

Could you provide a small sample of the input data and what the output data should be formatted to.

the html file contains:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!-- generated -->

<html lang="es">

<head>

<title> c30 </title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<meta http-equiv="Content-Style-Type" content="text/css;">

</head>

and i want it to write it all over again replacing <!-- generated --> with this try or any other thing

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

try this

<html lang="es">

<head>

<title> c30 </title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<meta http-equiv="Content-Style-Type" content="text/css;">

</head>

Edited by tsue
Posted

OK, what wakillon said will do the trick. You can find the function in the help file.

I thought you wanted to strip HTML syntax and just leave the plain text.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...