|
-
Jun 17th, 2010, 03:23 AM
#1
Thread Starter
Lively Member
Help with formatting csv file
Hi All,
i have written a small tool in vb .net 2005, it basically runs a batch command , dumps the output in a csv file & then loads the same csv in a richtextbox. Now the the problem is formatting the text placed in the RTB, my csv contains commas "," as seperators, so i'm using "replace" function to replace comma with a "tab" space, but due to un-even words the are still unformatted. For eg. the output looks something like this :
data1 data2 data3 data4
123 123anothertestString testdata3 test111
sample testString testdata3 test111
sample testingString anotherdata3 anothertest111
which shud look like a actual table (cnt really show 1 here) 
Any way i can achieve this in a RTB? or is there any other control i shud load the csv in? the reason i'm using RTB is that after the file is loaded i'm searching for certain text & highlighting it...
help is much appreciated...
-
Jun 17th, 2010, 03:36 AM
#2
Re: Help with formatting csv file
Rtf format has the formatting codes for tables, there must be some information on the web. (Simple test - prepare a table in MS Word and save the file as RichText) - there will be table there.
Still, if you're displaying some table the DataGridView fits better for this task (if you plan to process this data somehow).
For presentation purposes only you can use either RTF formatting for tables or convert your CSV into a HTML table and use a webbrowser control to display it.
-
Jun 17th, 2010, 05:15 AM
#3
Thread Starter
Lively Member
Re: Help with formatting csv file
 Originally Posted by cicatrix
Rtf format has the formatting codes for tables, there must be some information on the web. (Simple test - prepare a table in MS Word and save the file as RichText) - there will be table there.
Still, if you're displaying some table the DataGridView fits better for this task (if you plan to process this data somehow).
For presentation purposes only you can use either RTF formatting for tables or convert your CSV into a HTML table and use a webbrowser control to display it.
thx for reply...
yea...i cud read a table from rtf in "wordpad" , but that still doesn't point me anywhere i have data in "data1,data2,dat3" format in a csv how do i convert that to a table ? also wht would be simplest way to load a csv into a datagrid view ?
-
Jun 17th, 2010, 10:11 AM
#4
Thread Starter
Lively Member
Re: Help with formatting csv file
 Originally Posted by sk8er_boi
thx for reply...
yea...i cud read a table from rtf in "wordpad" , but that still doesn't point me anywhere  i have data in "data1,data2,dat3" format in a csv how do i convert that to a table ? also wht would be simplest way to load a csv into a datagrid view ?
sorry for double posting...but anyone pls ??? this is really urgent & important for me...
-
Jun 17th, 2010, 10:52 AM
#5
Re: Help with formatting csv file
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|