textfile

Possible data loss when Java application writes text files to disk

I wrote a simple Java application that reads and writes journals (encrypted text files) for a small company "XYZ". The journals are stored on an OS X server and all client computers access the journals on this server through an ethernet connection. Another independent company, "ABC", installed and configured the network and its nodes. Co...

How to read data from a repeated format of a large text file in MATLAB?

I want to read data of average saturation (%) for water as shown below. This data is a partial form of a large file, however the average water saturation (%) REPEATS itself in the given format only. Average Pressure Total Pore Volume psia 3884.9 ...

Dumping a Text file into a VB.net program

I have a VB.net program that I have reading a text file, what is the best way to put the text file into VB to be able to check if a string is on one of the lines in a text file, sample code would be helpful. ...

python - edit a text file

hi, I am using python and i want to delete some characters from the end of a text file. The file is big a and i dont want to read all of it and duplicate the interesting part. My best guess is that i need to change the file size.... can anyone help me please thanks ...

load text file list into <option> tags

Im working on a PHP project that involves selecting a song, hitting the submit button and then having the PHP loading the song player to the correct option. anyway: for the song selection I want to load these options from a txt file with the following formatting: All For Love Break Free Come to the River For You Name which I want to...

What is the fastest way to count lines and words in a text file in ANSI C?

What is the fastest way to count lines and words in a text file in pure ANSI C? A word is terminated by a space or period. Line is terminated by '\n'. This seems to be in C++. ...

Reading defining line of text file in java

I am trying to develop application for android . how I can get the defining line of textfile ? For instance I have to read 15. line of textfile. how I can do that? ...

How to make clear to user that the function's argument to be entered as string in Matlab?

I have the following function whose last argument is a name of the text file: function [property_without_headers]=gslib_file_to_matlab_var(nModel,nCell,gslib_file_name) % must enter the last argument, gslib_file_name, in single quotes as its treated as a string if nargin<3, % making third argument optional (code to be executed even whe...

How do I remove DB entries based on text file in SQL Server 2008 R2?

I have a list of words in a text file. Each word separated by a new line. I want to read all of the words, and then, for each word I have to look up the DB and remove rows that contain the words that were read from the text file. How do i do that? I am a newbie to DB programming and I guess we dont have loops in SQL, right? 1 - Read all...

Updating a specific portion of a text file in java

In my program I need to update the Balance column of the text file each time the user does a withdrawal. I used both the write methods as well as the append methods, but to no avail. Once the user has logged in, that particular line is stored in the array #PIN AccountNo Balance 1598 01-10-102203-0 95000 4895 01-10-102248-0 45000 9512 0...

how to search for a certain word in a text file in java

how to search for a certain word in a text file in java? Using buffered reader, I have this code, but I get a java.lang.ArrayIndexOutOfBoundsException Please help me determine what's wrong with my program. System.out.println("Input name: "); String tmp_name=input.nextLine(); try{ FileReader fr; fr ...

Can I use a text file as my database in ROR?

I would like to use a delimited text file (xml/csv etc) as a replacement for a database within Ruby on Rails. Solutions? (This is a class project requirement, I would much rather use a database if I had the choice.) I'm fine serializing the data and sending it to the text file myself. ...

how to bubble sort through a text file in java

How do I properly bubble sort through a text file by assigning the values to an array. In the code below I tried to assign the values from the text file to a string while there is still something to fetch. Then I used a for loop to assign the one that I have fetch to the array. Then tried to use the bubble sort to hopefully sort the numb...

how to update certain parts of text file in java

I want to be able to update a certain line on a text file. But I get the error that it cannot delete the file, why do I get this error? public class Main { public static void main(String[] args) { Main rlf = new Main(); rlf.removeLineFromFile("F:\\text.txt", "bbb"); } public void removeLineFromFile(String fi...

How to Log Console Screen into a Text File ?

Possible Duplicate: Mirroring console output to a file I've a console application in C# and I want to Log into a text file every text appears on the screen. How to do that ? Unfortunately this thread is closed despite of my comment about the Mirroring console output to a file. The accepted post as answer by that thread IS NOT...

[PHP] Small help saving to txt file

Hello there so I just setup this basic poll, I inspired myself from something I found out there, and it's just a basic ajax poll that waves the results in a text file. Although I was wondering, since I do not want the user to simply mass-click to advantage / disadvantage the results, i thought about adding a new text file that could sim...

Delete first N characters from TextFile without creating a new file (Delphi)

Hi! I just wanna to delete from specified text file first N characters, but i'm stuck. Help me please! procedure HeadCrop(const AFileName: string; const AHowMuch: Integer); var F: TextFile; begin AssignFile(F, AFileName); // what me to do next? // ... // if AHowMuch = 3 and file contains"Hello!" after all statements // it m...

searching a text file the writing result to memo, lazarus

this segment in my program first ads a customer to a textfile (declared in public variables) and saves it to a texfile. onbutton1click is the procudere to search the string thats in the editbox and return the relevant customer details to memo. the add customer works fine and adds to textfile, however when i search it returns nothing onto...

Python - Stripping timestamps and username from line in file

I'm writing a script that will print a random line of text from a file into an XCHAT channel. So far it works fine, but I want to add one last bit of functionality. I have logs with, for example, "Oct 23 12:07:59 (nickname> " appearing before every line of text. I just want to print the parts of the lines that follow the "(nickname>...

Using OleDbConnection to Read Tab-Seperated File

My tab-delimited file is something like this: ISO ISO3 ISO-Numeric AD AND 20 I've been trying the following code with no luck. OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source= |DataDirectory|;Extended Properties='text;HDR=Yes;FMT=TabDelimited'"); OleDbCommand cmd = new Ole...