Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate a TStringGrid from text file or/ word document

Status
Not open for further replies.

HappyLucky

Technical User
May 28, 2003
1
SG
Hi,

I've 2 questions:

1) I'm trying to fill a string grid(not using SQL query), but using values on ini file.

2) I want to search for a range of values and populate the values in the string grid. As my values are stored in text file/word document instead of database server, I cannot use SQL query or ADO to do a search.


This is my first time encounter it.

Does anyone know how to do the above.
Appreciate your help.

Thanks.
 
You could load the text file into a stringlist and run through it one item at a time.
Code:
var
  MyList : TStringList;
begin
  MyList := TStringList.Create;
  MyList.LoadFromFile('C:\MyFile.txt');
  
  {Add lines to stringlist here}
  
  MyList.Free;
end; [\code]

Arte Et Labore [rockband]
 
hi

1. Getting values from ini files.

if you got those values then just set them in the grid columns, rows, Items[x], etc.

2. if it is ini files then check the link above.
if it is text file or word doc. then is more difficult.

you got to search somehow to get those values from the doc/txt. Is data seperate by ; then search text stop when reach ;

check out different possibilities with grids:
dbgrid, stringgrid and drawgrids

cheers,
mha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top