So i was using RandomAccessFile for reading and writing in java. But when I write a string to the file the current contents of the file are being overridden. Here is my Code import java.io.RandomAccessFile; public class hello{ public static void main
I have in my file .mat three matrices, I need to delete one of them. I try clear ('Matrice1'), but it doesn't work.If you absolutely must completely delete the entire variable the most straightforward option is to load the data, remove the variable,
I have a program that i am working on that I want to do the following to a txt file Manipulate the following string of text abc#.fruit.date Change # to a number between 1 and 9 Change fruit to a fruit type like apple Change date to current date in YY
I have a file with 2939 lines, and I am trying to save the five lines together in one index of a 2D char array. So, char [][] myArray; myArray[0] = {} //<--char array of first five lines myArray[1]= //char array of next five lines the way I am implem
Someone knows a trick to have a PHP script self-restrict access to the file system (fopen, file_get_contents etc.)? Such calls should be blocked except for a handful of selected file names (log file, access to /tmp and similar). This is not a securit
I am trying to write a program that will create files, one file should look like this: 1 19 next file 2 18 3 17 etc... and so until the 19 is on the first line and 1 is on the second line, pretty much i am incrementing firs line from 1 to 19 and decr
This is more of a request for explanation of how the csv module really understands data coming in from a file. I don't quite understand a quirk I've come across a few times tied specifically to new line characters. With the following code: with open(
I often use library functions like File.Exists to check for a file's existence before opening it or doing some other action. While I have had good luck with this in practice over the years, I wonder if it is a poorly thought-out pattern. Any IO call
I have a strange case for search and replace a string in text file using python. Input Data: I have a text file which looks similar as shown below. QA1,QBFLUX,1.0 many lines QA2,QBFLUX,1.0 many lines QA3,QBFLUX,1.0 many lines QA4,QBFLUX,1.0 many line
I've got a file, consisting of a single line, which I intend to write quite often. Because of this, I don't want to close and re-open it over and aver again. Instead I want to call something that would erase file content. One way to accomplish what I
I can write a file to local storage of my (Samsung) tablet, with code like this: String fileName = "myfile.ser"; FileOutputStream fos = context.openFileOutput(fileName, Context.MODE_PRIVATE); ObjectOutputStream os = new ObjectOutputStream(fos);
I have a file text which splited by newline character. the text file such this: merah.dc kuning.dc hijau.dc biru.dc orange.dc mahopermanent.dc I want to count them by splitting with a newline character. so, the count of them are 6. I could only do th
I got some input in a txt file which I attached below. I want to extract the variables x1 to x6 where the values are in the first colum after the colon. (For example for the first x2 -1.55155599552781E+00) I tried already: data = textscan(fileID,'%s
I need some help with C++ I am trying to create a program which contains excersises to practice the different German cases. Hard-coding all questions and respective answers seems like an awful lot of work, and super inefficient. What I want my progra
What I want it not the normal fopen() function. I want to open the image, as in, when I double click on the image, then the way it opens in the imageViewer. I want to open it like that. Is there any way of doing that through a C code? So basically I
I want to write an ArrayList file data.txt my code: try{ File destination = new File("data.txt"); ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(destination)); os.writeObject(userList); os.close(); } catch.... This do's not
I have saved a text file from my app and I can open it again, but is there any way the user can gain access to this file to just do whatever they want with it? I tried printing the path which looks like this : /var/mobile/Applications/2DD5A15B-9BC8-4
I have a directory in aix which will receive files from a external application. My java program should pick only those files which are completely written by the application.It should not pick the incomplete files which are being still written by the
Possible Duplicate: Scanner issue when using nextLine after nextInt I'm very new to programming and i got an error that does not make sense me(i would have searched for the answer here, but i can hardly identify the problem). I am trying to read a fi
I've found how to do this with AIR and HTTP, but I need to, if possible, find a way to do this that circumvents both of these. I've been looking for a way to do this and am continuing to do so, but I haven't met with success just yet. Perhaps there's
On a Windows 7 (or server) box, we have a folder on a UNC share (cross machine UNC, not localhost). We rename that folder, and then check for the existence of a file at the new folder location. Even though it exists, it takes almost 5 seconds for Fil
I have a problem to write these detail in File. I am trying to write this detail in file but some how this function create File in specific location but its not writing anything into the file. public void writeBillToFile(double amount , double billin
I have nearly 500 text files with 10 million words. I have to index those words. What is the fastest way to read from a text file character by character? Here is my initial attempt: InputStream ist = new FileInputStream(this.path+"/"+doc); Buffe
What's the best way to write to the middle of a text file in Java? I know that there's no getting around reading the entire file to memory and then writing it back. But parsing is really one of my weak skills and the multitude of classes related to f
how to import a Text file content to a JTextArea in a Java application using JFileChooser?should be something like the following code: JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(null); //replace null with your s
The title may seem trivial, but this isn't as easy as it sounds. You can't just check the permissions on the file, because the file may not exist, and you may have the necessary permissions to create it and then write to it. But only if you have writ
i'm having a ListView control like I need to store the data from this ListView to an Xml File. So the xml file will be like <root> <Child Name ="A1" val1="1" val2="0"/> <Child Name ="A2" val1="1&
I need to read exactly 32 bits from a file. I'm using ifstream in the STL. Can I just directly say: int32 my_int; std::ifstream my_stream; my_stream.open("my_file.txt",std::ifstream::in); if (my_stream && !my_stream.eof()) my_stream >
why we use 'Throws IOException' in java File handling. i mean what is the purpose of using these two words in File handling?? Please help...The throws word means that the code could enter an error state, the IOExeption word describes the error state.
I am trying to read some text from a file and write it to another using open(), read() and write(). This is my open() for the file-to-write-to (I want to create a new file and write into it): fOut = open ("test-1", O_RDWR | O_CREAT | O_SYNC); Th