Hey
I'm trying to import a description from a web page, that is a little trikcy.
The web page code look like this:
--
Efter befrielsen må Danmark nødtvungent vælge side i en ny
verdensorden. Frihed med rationering, lynchstemning og et besat Bornholm.
Kongen er død – kongen leve. SAS, sortbørs og stof i lange baner.
Marshallhjælp og ministermøder. Påskekrise, kvinder med pibekrave og en kriminel edderkop.--
It translate into: Efter befrielsen må Danmark nødtvungent vælge side i en nyverdensorden. Frihed med rationering, lynchstemning og et besat Bornholm.Kongen er død – kongen leve. SAS, sortbørs og stof i lange baner.Marshallhjælp og ministermøder. Påskekrise, kvinder med pibekrave og en kriminel edderkop.--
As you can see I need a "space" after verdensorden, after Bornholm, and after baner.
I've tried with this code, but without luck:
Value := StringReplace(Value, #13#10, ' ');
Can anybody direct me ind the right direction?
CU
JJ
Problem with linebreak
Problem with linebreak
Last edited by allright on 2007-12-26 23:03:41, edited 1 time in total.
Yes, sorry I didn't include it in the first letter.
http://www.dvdoo.dk/dvd-film/danmarks-h ... _16513.php
CU
JJ
http://www.dvdoo.dk/dvd-film/danmarks-h ... _16513.php
CU
JJ
I did a short test with this code and it works for me (to test it, just copy it into a new script):
(imported text will be saved to description field, first word Efter is missing to keep it simple..)
You can pause the script and evaluate the variable Value, so you will see that the linebreaks are changed to spaces. If you cannot find what's going wrong, you should post your script here (or maybe send it via private message).
Code: Select all
program test;
const
CRLF = #13#10;
uses
StringUtils1;
var
Value: String;
begin
Value := GetPage(URLEncode('http://www.dvdoo.dk/dvd-film/danmarks-historie-1946-949-nye-forbindelser_16513.php'));
Value := TextBetween(Value, '1946-1949: Efter', '<br><br>');
Value := StringReplace(Value, #13#10, ' ');
setField(fieldDescription, Value);
end.
You can pause the script and evaluate the variable Value, so you will see that the linebreaks are changed to spaces. If you cannot find what's going wrong, you should post your script here (or maybe send it via private message).