text-files

Read a .txt file from an anonymous FTP page?

风流意气都作罢 提交于 2019-12-23 07:06:05
问题 My goal is to to convert a .txt file on an FTP page to a simple String for easy manipulation. The specific .txt file is here: ftp://ftp.nasdaqtrader.com/SymbolDirectory/nasdaqlisted.txt. It is an anonymous FTP page, so when I use my computer's browser, there's no need for a username or password. I've tried incorporating different codes and tips from the following sources: Reading Text File From Server on Android http://examples.javacodegeeks.com/core-java/apache/commons/net-commons/download

How do I sort data highest to lowest in Python from a text file?

不羁岁月 提交于 2019-12-23 06:08:54
问题 I have tried multiple methods in doing this but none of them seem to work The answer comes up alphabetically instead f=open("class2.txt", "r") scores=myfile.readlines() print(sorted(scores)) f.close() ['Anne, 3\n', 'Dave, 10', 'Jack, 4\n', 'Lucy, 8\n'] Also is there any way to get rid of the "/n" when it goes to the shell? 回答1: Based on the inputs and outputs, I'm guessing you're trying to sort the input names by the associated values. To sort numerically, you can either parse all the values

Open text files in matlab and save them from matlab

爷,独闯天下 提交于 2019-12-23 05:46:26
问题 I have a big text file containing data that needs to be extracted and inserted into a new text file. I possibly need to store this data in an cell/matrix array ? But for now, the question is that I am trying to test a smaller dataset, to check if the code below works. I have a code in which it opens a text file, scans through it and replicates the data and saves it in another text file called, "output.txt". Problem : It doesn't seem to save the file properly. It just shows an empty array in

Viewing large log files in JavaFX in a ListView

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 05:35:11
问题 I have written a JavaFx App to view log files. The files are opened each in a new tab and I run through the text and add it to the list views. I have created a cellfactory to highlight certain text in the list file and that is all working. The problem is that the log files are between 800-1300Mb. Opening 3-4 at once and the JVM reached its memory limit. Is there another way to do this to only have the text currently being displayed in the list view in memory and as I scroll load more into

How to convert the line endings of a text file from DOS to Unix?

一世执手 提交于 2019-12-23 05:33:07
问题 I have this php code saved in text file, I want to convert this text file to Unix line endings. How? <?php class City { private $lat=0.0; private $lng=0.0; private $name=""; private $visited=false; private $order=1; function City($name,$lat,$lng) { $this->name=$name; $this->lat=$lat; $this->lng=$lng; } function getName() { return $this->name; } function getLat() { return $this->lat; } function getLng() { return $this->lng; } function getOrder() { return $this->order; } function getVisited() {

Parsing large text files with Adobe AIR

余生长醉 提交于 2019-12-23 04:46:06
问题 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 anywhere from 100-500mb in size. So far, I've been able to to complete steps 1 and 2, here is my code: <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; import flash

How to read the text file from the Application Directory text file

久未见 提交于 2019-12-23 04:08:36
问题 I have a text file in the application project classpath Directory of Windows Form Application. Now at the time of installation I am trying to write a text value into the text file. Here is my Installer class code for text file.. File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + @"\" + "ConnectionString.txt",param3); After installation I want to retrieve the text that is entered in the "ConnectionString.txt" file and use it in the application but I am not getting how to retrieve the

Searching for line of one text file in another text file, faster

旧巷老猫 提交于 2019-12-23 03:27:45
问题 Is there a faster way to search each line of one text file for occurrence in another text file, than by going line by line in both files? I have two text files - one has ~2500 lines (let's call it TxtA), the other has ~86000 lines(TxtB). I want to search TxtB for each line in TxtA, and return the line in TxtB for each match found. I currently have this setup as: for each line in TxtA, search TxtB line by line for a match. However this is taking a really long time to process. It seems like it

How to generate text files and download a zip file in Javascript?

允我心安 提交于 2019-12-23 02:51:11
问题 I would like to know the best way in Javascript (maybe in JQuery) to do the following things without server coding if able : Generate around 20 text files from sets of objects. Zip these files into a ZIP file. Download this ZIP file. 1. Generate around 20 text files from sets of objects There are around 20 sets of objects, with around 90 objects in each set of objects. Here is an example of the sets of objects : var cardsPlayer1 = { name : "Player 1", [ {nbCopies : 3, name : "Noise"},

Getting txt from jar & stucked

穿精又带淫゛_ 提交于 2019-12-23 01:51:28
问题 I currently started programming a board game playground which can load different games. I store these games in file named config.txt, but I am having trouble accessing it. Firstly, I started with my favourite file approach: String fileAddress = "./resources/config.txt"; fis = new FileInputStream(fileAddress); reader = new BufferedReader(new InputStreamReader(fis)); But then when I built .jar file, it stopped working. For obvious reasons. So I found myself looking around and I found about