FAQ Database Discussion Community
c#,visual-studio-2010,csv,streamreader,streamwriter
I'm generating a list of from/to coordinate points, together with the distance/time between those points. For illustration: the header of the end product looks like this writer.WriteLine("fromX" + ";" + "fromY" + ";" + "toX" + ";" + "toY" + ";" + "distance" + ";" + "time"); The process of...
c#,textbox,.net-4.5,streamreader
It's simple what I'm trying to do; when I click a button, my app should check if textBox1.Text has a line from a text file. Note: I don't want to check if textbox has all the text file in it, just to see if it has a LINE from it....
asynchronous,f#,streamreader
On the line of Read large txt file multithreaded?, I have the doubt of whether it is equivalent to pass to each thread an sliced chunk of a Seq and whether it will safely handle the paralellism; is it StreamReader thread-safe? Here is the code I am using to test...
c#,file,stream,iteration,streamreader
Problem: I need to iterate through multiple files in a folder and read them. They are .txt files. While reading I need to note what words occured in each file. For example: File 1 text: "John is my friend friend" -> words: John, is, my, friend File 2 text: "John...
vb.net,streamreader
I simply need to read lines from a text file and show them. When I run this I can see that id does what I want, but after it reads the last value it just shows a blank form on my screen and does not move on. It seems like...
c#,string,list,streamreader
At the moment I am opening the .txt file twice, once to get the number of all the lines, second to add a line to a list as much as how much lines there are in the .txt file. Is there an easier/better way to do this? This is my...
c#,list,text,streamreader
I have a lot of text files and want to read them all by once, how do I do this? This is my code till now: List<StreamReader> lijst = new List<StreamReader>(); using (StreamReader qwe = new StreamReader("C:\\123.txt")) using (StreamReader qwer = new StreamReader("C:\\1234.txt")) lijst.Add(qwe); lijst.Add(qwer); But I get an ObjectDisposedException(Cannot...
c#,byte,filestream,streamreader,readline
I have a file, which contains data, I want to read it as byte[] and divide into 3 blocks. First line might be read as string, then 2nd block, might be 1-3 length of lines and all left bytes as block 3. I was wondering, how can I get that...
c#,lambda,streamreader
I have a method where I'm reading a textfile. I have to get the words in the textfile which start with "ART". I have a foreach loop which loops through the method. class ProductsList { public static void Main() { String path = @"D:\ProductsProjects\products.txt"; GetProducts(path, s => s.StartsWith("ART")); //foreach (String...
c#,file,split,stream,streamreader
I am currently trying to work on files, joining multiple of them and having problem because the last work from file 1 is linked with first word from file 2. For example: File 1:John has got new haircut File 2: Mike has got new haircut and it prints me "haircutMike"....
c#,winforms,streamreader,openfiledialog
I created simple example and I can't find solution anywhere. I want to save UI textbox data, and open it in another(same) windows form file. Here is code example: private void btnSave_Click(object sender, EventArgs e) { SaveFileDialog sfd = new SaveFileDialog(); if (sfd.ShowDialog() == DialogResult.OK) { StreamWriter write = new...
c#,optimization,character-encoding,streamreader
I am reading text files into program(they are code in Unicode, the output must be in utf-8). The code below works fine for smaller ones (around 150 lines, where line is one word only), however when I am using it on bigger files(like 20.000 line, still only one word on...
c#,linux,mono,streamreader
I am trying to write some simple code to index some wikipedia xml pages. The idea was to get the byte offset of each character by reading in a character using streamreader, then saving the position from the byte stream so I could get back to that position later. using...
c#,streamreader,streamwriter
I've been struggling to figure out exactly the best way to handle my situation for a few days now. I'm not able to get the program to function the way I desire. What I have is a .txt file, that has two columns, and 11 seperate lines. It looks as...
vb.net,listbox,integer,streamreader
I have created a program that successfully reads integers only from a text file that contains string as well into a listbox. For example: The text file contains: Tyler 7 Daniel 2 Mike 6 Rory 9 The listbox will then show: 7269. However I plan to sort these numbers from...
vb.net,while-loop,streamreader
I'm working on a txt file and I was wondering if there was a way to force the streamreader to read the next line after I've used the value of the one it currently read. My code: Private Sub subTest() Dim sr As New StreamReader("d:\input\cleanedUp.txt") Dim doc As New XmlDocument...
c#,asp.net,.net,streamreader
i have one important project. i have to draw dynamically captcha image from running other web site captcha. here i have to made one web request to other login page. and draw captcha same as displayed other web site. here i have to set this captcha image src to my...
c#,arrays,loops,streamreader
I'm working on a small program which holds information about people. The information is stored in a textfile as a sentence and the words are separated by ";". I know how to read the lines with a streamreader, I do this upon clicking on a button. I then split the...
c#,datagridview,streamreader,streamwriter
I am using a StreamWriter to write all values on all exisiting cells in a dataGridView, that writer is working perfect. But my reader isn't doing its work very good. This is my writer code(which has no problem): StreamWriter writer = new StreamWriter(valuePath); foreach (DataGridViewRow row in dataGridView1.Rows) { foreach...
c#,arrays,tokenize,delimiter,streamreader
I am trying to figure out how to tokenize a StreamReader of a text file. I have been able to separate the lines, but now I am trying to figure out how to break down those lines by a tab delimiter as well. This is what I have so far....
c#,asp.net,streamreader,using
I have this code that works on one Windows Server 2008 R2 but not a fresh new server 2008 R2 install. The code below is locking some text files on the new server but not the old one which is very strange. I'm very sure it is this code because...
c#,sockets,streamreader
I have a client which talks to a server, the code below is supposed to print on the console what was typed in - this spans over multiple lines. The problem is that it displays all the lines, then throws an exception. I have tried different ways in order to...
c#,streamreader,streamwriter
I'm working on a video game with C#. I have a list of users with their coin amounts in a .txt file, and I want for their amounts to be overwritten when they save. I can't figure out how to use SteamWriter within SteamReader without a "file already being used"...
vb.net,winforms,text-files,streamreader
I apologise in advance if there is already an answer to this problem; if so please just link it (I have looked, btw! I just didn't find anything relating to my specific example) :) I have a text (.txt) file which contains data in the form 1.10.100.0.200 where 1, 10,...
c#,streamreader
I'm new to C# obviously. I'm looking for a way to read each line in a text file and search for a unique string in that text file. If if finds the string, then I need it to read the next line only and output it to a textbox. Any...
c#,linq,streamreader
I want to skip lines that i will read in the text file, as you can see below the line 0, line 1 and line 2 is skip (first three lines of text file) then it follows a read this (3 read this) then next is (4 skip this) this...
c#,winforms,streamreader
I need to read from a text file and only get certain data from it. The text file has multiple lines, similar to below 12/05/2014 06:52 c:\BACKUPS\INT100\BACKUP\BACKUP.ZIP 12/05/2014 06:51 c:\BACKUPS\INT1000\BACKUP\BACKUP.ZIP I need the date, time and the number (in this case 100 and 1000), but can't figure out how to...
c#,arrays,streamreader,streamwriter,file.readalllines
I need some help with file streaming. I have a program that will record names into a string array that will be written to a .txt file. Then if a user wants to delete a specific string from the array in the .txt file. the program will search for the...
c#,split,streamreader
I am reading a text file with this structure: 20150218;"C7";"B895";00101;"FTBCCAL16" I read the line and split like this: System.IO.StreamReader fichero = new System.IO.StreamReader(ruta, Encoding.Default); while ((linea = fichero.ReadLine()) != null) { // Split by ";" String[] separador = linea.Split(';'); } But when I see the content of "linea", I have...
.net,performance,stream,streamreader,httpwebresponse
I'm making a Web Crawler and I just found out that one of my methods, GetHTML, is very slow because it uses a StreamReader to get a string of the HTML out of the HttpWebResponse object. Here is the method: static string GetHTML(string URL) { HttpWebRequest Request = (HttpWebRequest)WebRequest.Create(URL); Request.Proxy...