files

How to ReadWrite into textfile in android ?

How to read and write strings in text file in android which is kept in raw folder and also how to clear contents of that file in android? I have done this way and my "temp.txt" file is in /raw folder. But i am not getting any output in file. Also I am not getting any error for this. FileOutputStream fos = openFileOutput("temp",...

copy lines in range using Python/Jython

Hi all, I have a server log file which is constantly updated. after some script execution, I want to collect the relevant part of my execution from the server log into an execution log. Basically, I need to capture the last line number of my server log before the test started (which I already know how to do), say X, and after executi...

list recursively all files and folders under the giving path?

I want to list the "sub-path" of files and folders for the giving folder (path) let's say I have the folder C:\files\folder1\subfolder1\file.txt if I give the function c:\files\folder1\ I will get subfolder1 subfolder1\file.txt ...

Copying files across computers using SSH and MAC OS X Terminal

Im trying to copy my .profile, .rvm and .ssh folders/files to a new computer and I know how to use the cp and ssh commands but I'm not sure how to use them in order to transfer files from one computer to another. Any help would be great, thanks! ...

.shp file for generating maps

i got all these files from customer i was able to generate map using shp file alone i converted shp --> kml and viewed in google map what do i do of prj and dbf file. how do they contribute in map generation please help ...

How to download multi files in c#

Hi, i won't to download multi files at this same time using c#, but i don't know how. Please help. ...

ASP.NET System.IO.File.Open("C:\TEST.TXT", System.IO.FileMode.Open); ERROR FILE NOT FOUND? LOCAL:

Dumb question.. is this c# code intended to read local client files? System.IO.FileStream content = System.IO.File.Open("c:\test.txt", System.IO.FileMode.Open); It gives me error FILE NOT FOUND I'm running Windows 7 and IE 8. ...

transfering various files one after the other - java sockets

I am writing a socket server, that when the client requests, the server will send some files, one after the other. Supose I have file1, file2, and file3 to be transfered. How can I know on the client side, if the file1 has finished, and file2 has started? For messages I am using a DELIMITER character (\r\n). Should I use thise for files ...

Reading large csv files

Which is the most performant way to read a large csv file in .NET? Using FileStream? or another class? Thanks! ...

Why break classes up into multiple source files in C++?

What exactly is the point of having multiple source files in c++? Sorry if this incredibly simple. ...

Fastest way to remove duplicate lines in very large .txt files

What is the best way to remove duplicate lines from large .txt files like 1 GB and more ? Because removing one-after-another duplicates is simple, we can turn this problem to just sorting file. Assume, that we can't load whole data to RAM, because of it's size. I'm just waiting to retreive all records from SQL table with one unique in...

How would I write some values/strings in particular columns of a file in python

I have some values that I want to write in a text file with the constraint that each value has to go to a particular column of each line. For example, lets say that I have values = [a, b, c, d] and I want to write them in a line so that a is going to be written in the 10th column of the line, b on the 25th, c on the 34th, and d on the 4...

C: How to read only the first word from each line?

Hi, I've done many simple procedures, but I'm only trying to read the first word into a char word[30] , from each line of a text file. I've tried, but without success. Oh, I have to reuse that char each time I read it. (To put in an ordered list each time I read it). Can anyone help me and show me a way to read this way from a file, i...

Why can't files in my iPhone NSBundle folder be deleted?

I'm having trouble figuring out why files in my iPhone app seem to persist, even when I've deleted them. Here's the code that's giving me trouble: NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *bundlePath = [[NSBundle mainBundle] bundlePath]; NSString *folderPath = [bundlePath stringByAppendingPathComponent:@"fi...

how i can delete something from file ?

i want to delete something from each line of file for example :- i have the following path in file : /var/lib/svn/repos/b1me/products/payone/generic/code/core/db/fs-type /var/lib/svn/repos/b1me/products/payone/generic/code/fees/db/fs-type /var/lib/svn/repos/b1me/products/payone/generic/code/merchantserver/db/fs-type i want to do ...

how to get file name on perl of windows popup?

I'm using json to open the user popup. I used to use basename( $_FILES['userfile']['name'] ) on php, how to do that on perl? Server side code: #!/usr/bin/perl use CGI; print "Content-type: text/html; Cache-Control: no-cache; charset=utf-8\n\n"; @allowedExtensions =("jpg","tiff","gif","eps","jpeg","png"); my $q = CGI->new(); my $...

What is the simplest way to write 4 arrays into a file in a multiplatform way?

Say we have a struct of an int array, a float array etc. and we need to write them into a binary format file for fast reloading. Can this be done in a simple way? Should the files be several for each of the array? ...

Simple question on file seeking in C.

Say I write in a file Mesh: 1 Vertices: 345 Indices: 123 V: 1,3,4 1,4,5 .. Mesh: 2 Vertices: 456 Indices: 42 etc. How do I go about seeking at any position? E.g. I want to go to Vertices: of Mesh 2 or V: of Mesh 3 etc. What's the proper way to go about these things? ...

how i can add Add text at the beginning of each line?

how i can add Add text at the beginning of each line? for example:- i have file contain:- /var/lib/svn/repos/b1me/products/payone/generic/code/core /var/lib/svn/repos/b1me/products/payone/generic/code/fees /var/lib/svn/repos/b1me/products/payone/generic/code/2ds i want it to become:- svn+ssh://svn.xxx.com.jo/var/lib/svn/repos/b1m...

How to safely open/close files in python 2.4

I'm currently writing a small script for use on one of our servers using Python. The server only has Python 2.4.4 installed. I didn't start using Python until 2.5 was out, so I'm used to the form: with open('file.txt', 'r') as f: # do stuff with f However, there is no with statement before 2.5, and I'm having trouble finding ex...