Downloading text files using Powershell

I'm trying to download and save the text file http://www.gutenberg.org/cache/epub/164/pg164.txt using Powershell. I tried using the code: $curl http://www.gutenberg.org/cache/epub/164/pg164.txt -OutFile verne.txt But instead of saving the text file i

Open a file and create a 2D array

I have the file mapData.txt, which contains several arrays: [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1] [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1] [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1] [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1] [1,0,0,0,0,0,0,0,0,0

Reading a text file in a 2D array

I need to read a text file into a 2D array, I can read files into the program perfectly fine (see my code below) however I cannot get my head around how to read them into a 2D array. The array the function is reading into is a global array hence why

Transform a list into a list of Python lists 3

I have a list file made up of car details. e.g. 1000001 Volvo v8 1000002 Mazda 2.0 It sounds like you need to split each line; you can use a list comprehension, as follows cars = [line.split() for line in open("Cars.txt")] As mentioned in the co

How to import a text file into MSSQL

I need to import this file into the following table structure: CREATE TABLE [dbo].[tab_sorts]( [row] [int] IDENTITY(1,1) NOT NULL, [id] [int] NOT NULL, [date_sort] [nchar](10) NOT NULL, [date_day] [int] NOT NULL, [date_month] [int] NOT NULL, [date_ye

Java read text and manipulate

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

How to display a single value of a value in a list

I have a problem, I want the program to only show the highest score for each person in the list. Within the text file, there are 3 peoples names e.g. Tom, James and Dave, and there scores, so it will look like this. Tom,9 Tom,8 Tom,2 James,9 James,4

How to add a new unique string to the text file

I have a text file contains several lines with words, for example like this cards door lounge dog window I want to add a new word into that list with the condition that it does not already exist in the list. For example I want to add wind or car I us

Write to a text file

So, I have this code: #include <stdio.h> int main(int argc, char *argv[]){ FILE *ReadFile, *WriteFile; float key; int quantKeys,T; int i; /* errors verification */ if (argc < 3){ printf(" Use the correct entry parameters.\n"); exit(1);

What will a text file added in Java look like?

When in Java, I append text to the end of a text file using FileWriter. Will this new text be on the direct next line of the file or will it leave a line between the old text and new text. Presuming my raw data has no new lines and i just rely on the

Get the number of lines in a text file using R

Is there a way to get the number of lines in a file without importing it? So far this is what I am doing myfiles <- list.files(pattern="*.dat") myfilesContent <- lapply(myfiles, read.delim, header=F, quote="\"") for (i in 1:

vbscript code to read text file entry avoiding manual effort

I am drilling down Internet to get Vbscript code, where input is read from text file one per line and pass it to the commands in script. I am just a beginner and need help with this. Basically I am gathering script to get pending patches of servers i

how can I convert the text file to an int table list

I have a text file containing the following content: 0 0 1 0 3 0 0 1 1 3 0 0 1 2 3 0 0 3 0 1 0 0 0 1 2 1 1 0 0 1 0 3 0 0 1 1 3 0 0 1 2 3 0 0 3 0 1 0 0 1 2 3 0 0 3 0 1 There are no spaces between two rows but there is a space between the numbers. I wa

How to add a line to a text file without overwriting it (JAVA)?

My data is stored in an ArrayList whose size increases during program execution. I managed to save all the data whenever the size increases, but this brings me to overwrite the data already stored. The solution is to go directly to the bottom line an

How to perform multiple functions on a text file

I am very new to python, and having gone through some exercises I thought it would be a good idea to write my first program! (Perhaps an overly ambitious goal). I have a textfile and want to extract several pieces of information from it. The text fil

Most efficient way to write a matrix of bytes in a text file

I have a problem in Java writing a 3D byte matrix (as unsigned bytes) to a text file. The matrix is 3D and looks like wMatrix3D[k][j][i]. I want to it to a textfile so the values are separated by white space and a new line break every 1,000 values (t

Statement of Regular Expression

I've never been good with regex and I can't seem to get this... I am trying to match statements along these lines (these are two lines in a text file I'm reading) Lname Fname 12.35 1 Jones Bananaman 7.1 3 Currently I am using this for a while stateme

trying to print a line a text file in c

i am trying to print a line from a text file then go to the next line and print that until there is no more lines left to print. This is what i have so far, but it only works the first time that i run the program. void ReadFile(FILE *a) { char line[2

LOAD DATA INFILE equivalent in Oracle

I just was wodering if there's an equivalent to MySQL LOAD DATA INFILE statemnent in Oracle? I need it because I want to read from a huge textfile into a database table.Oracle gives the SQLLoader commandline utility. But it relies on a proper formatt

Read the txt file with multi-threaded python

I'm trying to read a file in python (scan it lines and look for terms) and write the results- let say, counters for each term. I need to do that for a big amount of files (more than 3000). Is it possible to do that multi threaded? If yes, how? So, th

Writing in the middle of a text file in Java

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 can I read 950 MB txt file in C #

I need to read a 950mb txt file in a console app without getting a System.OutOfMemoryException, with the following structure: "6152902100000017";20110701;20110701;53;"D";30359130;"NOTA DE DEBITO";"DEB.COMPRA BCO";0;

how to parse unicode that is read from a file in java

This question already has an answer here: How to unescape a Java string literal in Java? 10 answers I have written a text file with the following contents: \u0032\u0142o\u017Cy\u0142 Then I have used FileReader und BufferedReader to read the file. pu

Processing large text files

Problem: I've a huge raw text file (assume of 3gig), I need to go through each word in the file and find out that a word appears how many times in the file. My Proposed Solution: Split the huge file into multiple files and each splitted file will hav

Problem with printing to text file

I am completely stumped. I have a program that pulls information stored in a database, assigns the database values to a corresponding class. The class has a print method that prints the values of it's fields. The users type in either an order id or o