473,326 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to print the string values line by line ?

147 100+
Hi,

I am opening the "text file" and writing in that text file using VB.

For example:

Expand|Select|Wrap|Line Numbers
  1. mystring="Hi,how are you?,fine"
  2.  
  3. 'writing in text file
  4.  
  5. print #1; "Name";tab(25);"Location";tab(40);"Description";tab(60);"Designation"
  6. print #1;rs!name;tab(25);rs!location;tab(40);mystring;tab(60);rs!designation
  7.  
my output is:
xxx chennai Hi,how are you?,fine manager



But i don't need like as above output.

I need output like this:

xxx chennai 1. Hi Manager
2. how are you?
3. fine


I want to print the description in vertically by splitting with comma delimited.

Please help me out and give me some idea to solve this problem. Thanks in advance
Jan 9 '11 #1
1 1435
Guido Geurs
767 Expert 512MB
You can split strings into an array by a delimitor like "," with the command Split(string,delimitor).
This split Mytext and prints it in an textbox:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2. Dim mystring As String
  3. Dim ARRSPLIT() As String
  4. Dim ARRSPLITidx As Integer
  5.    mystring = "Hi,how are you?,fine"
  6.    ARRSPLIT = Split(mystring, ",")
  7.    For ARRSPLITidx = LBound(ARRSPLIT) To UBound(ARRSPLIT)
  8.       Text1.Text = Text1.Text & ARRSPLIT(ARRSPLITidx) & vbNewLine
  9.    Next
  10. End Sub
Jan 9 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Michael Krasnyk | last post by:
Hi, How can I print variable values by their names? For example: import sys for str in dir(sys): print str Will be printed only variable names, but I need values from list of variable...
13
by: Vinu | last post by:
hai i have a problem i con't able to print the values of argv int main(int argc, wchar_t* argv) { return o; }
13
by: Haines Brown | last post by:
I have a style for a list: dl { line-height: 1; margin-bottom: 1em; } But the W3C CSS validator says: Line: 124 Context : dl Invalid number : line-height Parse Error -
2
by: lekshminair | last post by:
hello friends, can u help me. how to print first string in a line.(before first space) for example: String str={"Hello world java"} output Hello
0
by: gujarsachin2001 | last post by:
Hello friends, I am working on one of web application which needs to print datagrid values on one of the button click event.So can anybody please help me out. thanks, Sachin.
1
by: pappu | last post by:
Hello friends, I am working on one of web application which needs to print datagrid values on one of the button click event.So can anybody please help me out. thanks, Sachin.
5
by: unknown418 | last post by:
I am confused what is the efficient way to read in a file with multiple values per line. Each value is separated by a space character. The values could be characters or real values. I am using...
0
by: kimmelsd33 | last post by:
I am adding to my software. I have placed about 30 checkboxes on a form. Based on which checkboxes are selected, I want to print the values to a tab delimited text file. For instance, the first...
0
by: ghjk | last post by:
I'm using jsp. I want to print string array values . How can I do that? please help me. This is my code. ArrayList settings = (ArrayList)session.getAttribute("settingList");
4
by: AnagJohari | last post by:
I m not able to understand how i print the values of predefined symbolic constant. i have to print the values of _lINE_ The line number of the current source code line (an integer constant) _FILE_...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.