I wan to split my content(in horizontal)in my text file to vertical...

string filePath = @"c:\Users\Fish\Desktop\fyp-coding\Data.txt";
                    string line;

                    if (File.Exists(filePath))
                    {
                        StreamReader file = null;
                        try
                        {
                            file = new StreamReader(filePath);

                            while ((line = file.ReadLine()) != null)
                            {
                                MessageBox.Show( line);
                            }

                           
                            foreach (string lines in File.ReadAllLines(filePath))
                            {
                                string[] parts = lines.Split(',');
                                foreach (string part in parts)
                                {
                                    MessageBox.Show(part);
                                }
                                
                            }
                        }
                        finally
                        {
                            if (file != null)
                            file.Close();
                        }

                    }

I try many times already..It always give me horizontal...how to change it to vertical???? can anyone help me..?

You have to collect(append) the first part of all your lines read in a new line.
Do the same for the second and so on.
Write these lines to a new file.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.