Question : (Another) Extract data from HTML table

Hi all

can someone show me how to extract the table's info (data) into a TStringGrid directly from the location below please?
i need only what we see :
http://www.emsc-csem.org/Earthquake/index.php?filter=no&view=1&min_lat=10&min_long=-30&max_long=65


i also tried to extract the data from this CSV
http://www.emsc-csem.org/Earthquake/index.php?filter=yes&start_date=2010-07-01&end_date=2010-07-19&min_mag=1&min_intens=0&max_intens=8&export=csv

the CSV is the result of this page :
http://www.emsc-csem.org/Earthquake/index.php?filter=yes

but the CSV itself is so messy, that even the Excel couldn't read it properly...

i saw other posts about extracting tables from HTML's to a delphi program here in EE, but they didnt work for me, or maybe i did something wrong...

btw, i dont know if it means anything, but the TWebBrowser got stuck when i tried to load these pages in it...

i just need something that will get me the data from the internet into the StringGrid with a click (and no ADO or .NET if possible please)

i use Delp 6 Ent if it helps

MANY thanks

Answer : (Another) Extract data from HTML table

The CSV is fine, except it is not comma-separated, it is semicolon separated.
Once you have the CSV file, you can populate the TStringGrid as follows.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
var
  sl: TStringList;
  s: string;
  i: integer;
  iStart: integer;
  iEnd: integer;
  col: integer;
begin
  sl := TStringList.Create;
  try
    sl.LoadFromFile('C:\export_EMSC.csv');
    StringGrid1.RowCount := sl.Count;
    StringGrid1.FixedCols := 0;
    StringGrid1.ColCount := 9;
    for i := 0 to Pred(sl.Count) do
    begin
      s := sl[i] + ';';
      col := 0;
      iStart := 1;
      iEnd := 1;
      while (iEnd <= Length(s)) and (col < 9) do // col<9 to protect against bad file
      begin
        if s[iEnd] = ';' then
        begin
          StringGrid1.Cells[col,i] := Copy(s, iStart, iEnd-iStart);
          iStart := iEnd+1;
          Inc(col);
        end;
        Inc(iEnd);
      end;
    end;
  finally
    sl.Free;
  end;
end;
Random Solutions  
 
programming4us programming4us