textfiles

Code Golf 4th of July Edition: Counting Top Ten Occurring Words

Given the following list of presidents do a top ten word count in the smallest program possible: INPUT FILE Washington Washington Adams Jefferson Jefferson Madison Madison Monroe Monroe John Quincy Adams Jackson Jackson Van Buren Harrison DIES Tyler Polk Taylor ...

Hiding, showing, and applying functions to only visible lines with ability to restore in VIM?

I have an editor I am attempting to emulate that has some very nice features. One feature of the editor is to hide lines of a file (similar to a fold but without decorations) and apply commands operations only to those lines which remain visible. The hidden lines can then be brough back. For example the user sees Smurf Apple ...

Reading a UTF-8 Unicode file through non-unicode code.

I have to read a text file which is Unicode with UTF-8 encoding and have to write this data to another text file. The file has tab-separated data in lines. My reading code is C++ code without unicode support. What I am doing is reading the file line-by-line in a string/char* and putting that string as-is to the destination file. I can'...

Flash Lite 1.1 Read File?

Is it possible to read a simple text file (stored on the mobile phone) with Flash Lite 1.1? ...

Delete specific line from a text file?

I need to delete an exact line from a text file but I cannot for the life of me workout how to go about doing this. Any suggestions or examples would be greatly appreciated? Related Questions Efficient way to delete a line from a text file (C#) ...

Opening a large text file (30mb) consumes 500,000k of Firefox memory

Hi all, I was initially dabbling with IFrames to launch a document, and found that for large files, the memory in all browsers (I first noticed this in FF) jumped to 500,000 K. At first I thought it might have been some bad JS code that I had written, but removing all the extraneous code and just OPENING the text file still displayed ...

Java Text File Encoding

I have a text file and it can be ANSI (with ISO-8859-2 charset), UTF-8, UCS-2 Big or Little Endian. Is there any way to detect the encoding of the file to read it properly? Or is it possible to read a file without giving the encoding? (and it reads the file as it is) (There are several program that can detect and convert encoding/form...

Using LINQ to query a text file

I have a simple text file containing some CSV with the following structure: @Parent1_Field1, Parent1_Field2, Parent1_Field3 Child1_Field1, Child1_Field2 Child2_Field1, Child2_Field2 ...etc. @Parent2_Field1, Parent2_Field2, Parent2_Field3 Child1_Field1, Child1_Field2 Child2_Field1, Child2_Field2 ...etc. '@' indicates a parent object ...

Microsoft's Microsoft Text Driver sees text as float operation.

Using .NET I have a text file with comma separated data. One of the columns consists of text like the following : 1997/020269/07 Now when I do a select with an OdbcCommand the string is seen as a float and it returns the 'answer' instead of the actual text! How can I get the actual text? Am I going to be forced to parsing the file ma...

Writing a Text file from VB.NET (Encoding Problem)

I am writing an application that must generate a plain Text file with fixed sized columns. my current code is: Dim MyFilePath As String = Path & FILE_PREFIX & FileNr & ".TXT" IO.File.Delete(MyFilePath) Dim FileStr As New IO.StreamWriter(MyFilePath, False, <ENCODER HERE>) Do While r.Read FileStr.WriteLine(r("TXTLine")) Loop FileSt...

creating/editing textfile through vb.net

how do i code in vb.net the algorithm below. tnx! Procedure logfile() { if "C:\textfile.txt"=exist then open the textfile; else create the textfile; end if go to the end of the textfile; write new line in the textfile; save; close; } ...

Parsing large text files with Adobe AIR

Hello, I am trying to do the following in AIR: browse to a text file read the text file and store it in a string (ultimately in an array) split the string by the delimiter \n and put the resulting strings in an array manipulate that data before sending it to a website (mysql database) The text files I am dealing with will be anywher...

Easiest way to read text file which is locked by another application

I've been using File.ReadAllText to grab some csv, but every time I forget to close the file in Excel, the application throws an exception because it can't get access to the file. (Seems crazy to me, I mean the READ in ReadAllText seems pretty clear) I know that there is File.Open with all the bells and whistles, but is there an 'inter...

What's a reasonable maximum size that a cross-platform application should allow a text file to get?

What's a reasonable maximum size that a cross-platform application could allow a text file to get? I understand that this is an oversimplified question so allow me to explain. My team is implementing a bulk load interface for clients to load data into our database. It will write out a CSV file and then load that file into the appropri...

How to print an array to a .txt file in Matlab?

I am just beginning to learn Matlab, so this question might be very basic: I have a variable a=[2.3 3.422 -6.121 9 4.55] I want the values to be output to a .txt file like this: 2.3 3.422 -6.121 9 4.55 How can I do this? fid = fopen('c:\\coeffs.txt','w'); //this opens the file //now how to print 'a' to the file?? ...

Read a txt file containing a matrix of numbers separated by spaces and lines into an array

I've been trying to read a txt file containing a formatted matrix (9x9) into an int array. The txt file is selected by the user using NSOpenPanel. An example txt file: 2 7 9 1 6 2 1 1 1 9 1 3 3 4 0 6 8 5 5 3 2 9 3 8 6 7 0 6 0 9 2 5 6 4 8 0 3 2 0 4 0 5 0 6 0 4 0 5 4 0 3 9 0 0 6 4 1 3 2 5 7 2 0 6 5 7 2 1 3 0 9 3 1 0 2 7 5 1 0 0 0 I...

Process Large Textfiles Quickly w/ VBA

Hey Everyone, I'm having a hardtime speeding up the processing of a very large textfile (~100 Meg or so). I've made caution to be very diligent using the redim preserve calls, and yet the function still takes 5 minutes or so to run. The textfile is basically sub reports which i'm trying to parse out. I only have access to the large f...

Reading data into MATLAB from a textfile...

I have a textfile with the following structure: 1999-01-04 1,100.00 1,060.00 1,092.50 0 6,225 1,336,605 37 1999-01-05 1,122.50 1,087.50 1,122.50 0 3,250 712,175 14 ... The file contains repeated sets of eight values (a date followed by seven numbers, each on their own line). I want to read it into MATLAB and get the values into diff...

Bash - Format a Textfile - Pair every two lines

Hi, With a simple bash script i generate a text file with many entrys like this: 192.168.1.1 hostname1 192.168.1.2 hostname2 192.168.1.3 hostname3 Now i want to reformat this file, that it looks like this: 192.168.1.1 hostname1 192.168.1.2 hostname2 192.168.1.3 hostname3 Some ideas to solve this? Sed maybe? Thanks for help and be...

J2ME/Blackberry - how to read/write text file?

hi, please give me a sample code for read/write text file in blackberry application. ...