textfiles

make a list out of a text file in java?

I have a text file full of numbers and I want to read the numbers into Java and then make a list that I can sort. it has been a while since I have used java and I am forgetting how to do this. the text file looks something like this 4.5234 9.3564 1.2342 4.4674 9.6545 6.7856 ...

getting null when reading a text file in java using buffered reader

I'm having a problem reading a text file in java and assigning it to an array. The program is running but I'm getting null. I tried changing the code to its simplest for just like what you see below. Because this one should really loop through the text file. But I'm doing it this way so that I will easily see where's the problem. But the...

randomizing text file read in java

I am trying to read a text file in java, basically a set of questions. With 4 choices and 1 answer. The structure looks like this: question option a option b option c option d answer I have no trouble reading it that way: public class rar{ public static String[] q=new String[50]; public static String[] a=n...

How do you dynamically identify unknown delimiters in a data file?

I have three input data files. Each uses a different delimiter for the data contained therein. Data file one looks like this: apples | bananas | oranges | grapes data file two looks like this: quarter, dime, nickel, penny data file three looks like this: horse cow pig chicken goat (the change in the number of columns is also intent...

Splitting gzipped logfiles without storing the ungzipped splits on disk.

I have a recurring task of splitting a set of large (about 1-2 GiB each) gzipped Apache logfiles into several parts (say chunks of 500K lines). The final files should be gzipped again to limit the disk usage. On Linux I would normally do: zcat biglogfile.gz | split -l500000 The resulting files files will be named xaa, xab, xac, etc ...

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...

CheckedListBox - How to programmatically ensure that one and only one item can be checked at any given time?

Hello Coders, I want to use a CheckedListBox in an application where each item in the ListBox is the name of a folder on my hard drive and for the purpose of reading and writing text files to and from each of these folders I want to ensure that one and only one item (a folder) can be selected at any one time in the CheckedListBox How c...

Convert text file into 2d array in vb.net

I have a text file like 11111 10001 10001 11111 I need to read this into a 2d array of integers I already have the code to read the file Dim fullpath = "Path to File" Dim objReader As StreamReader objReader = New StreamReader(fullpath) But i dont know what to do after that. I'm know this is something simple but i just cant think...