I am attempting to make an interface with textfields where the data entered into the fields is stored in a variable, and then written to an external file. I am trying to use FileWriter fw = new FileWriter() to tranfer the variable to the file, but I cannot find an option available to send a variable, the only options when using fw.write() are strings and ints.... This is the block of code I am talking about: try { try (FileWriter fw = new FileWriter(f)) { fw.write(""); // I need to put a variable in here?? } } catch (Exception ex) …

Member Avatar
Member Avatar
+0 forum 3

I am writing a program that has a few requirements. Here is what it looks like the picture that I attached. [B][COLOR="red"]The first button is used to add (append) a record to a text file containing MP3 records.[/COLOR][/B] When an MP3 is added to the file, all text fields should be cleared and the new record entered should be displayed by itself in the text area: If a field is missing inform the user. Add AT LEAST six MP3 records. The data must be written to the text file using a “:” as a separator: artist name:song name:album name:tract length(in …

Member Avatar
Member Avatar
+0 forum 6

Basically I use text files to hold the program data, which is loaded in to variables when the program starts. I use StreamWriter to write to the text files when they update within the program. This is fine although the writer adds a extra line when I do not want this, which causes the program to error on the next use. This is what I mean: [CODE]For x = 1 to 4 FileWriter.WriteLine(user(x) & "," & pass(x)) Next[/CODE] Comes out as (the text doesn't matter here) 'line1 'line2 'line3 'line4 | <---- but the cursor goes here making the application …

Member Avatar
Member Avatar
+0 forum 3

good day everyone! I have a problem regarding to my program. i want to create a multiple text file. To be clear to you, i'll give an example. for example I want create a textfile named as text1.txt and another textfile text2.txt. What possibly is the solution to prevent the 1st txt file to be overwritten by the 2nd txt file. Is there any easy code that can I use? Thank you in advance! :)

Member Avatar
Member Avatar
+0 forum 2

Hi I'm trying modify an application to read in text files and collect pieces of data from them to use as input for an application. The data I need to collect from the individual files include doubles, int, and strings of varying lengths depending upon individual text files. There is a lot of content in the files that I do not need to read. My questions are 1) Is it best to use FileReader or FileWriter? 2) Is there any other way to skip complete lines other that Reader's skip(long n) method? 3) What methods should I use collect only …

Member Avatar
Member Avatar
+0 forum 4

The End.