text-files

how to get a conf.txt path in eclipse

与世无争的帅哥 提交于 2019-12-25 11:34:39
问题 I have an eclipse project and in one folder there is a text file "conf.txt". I can read and write the file when I use the path on my Computer. But I have to write my own folders there as well, not only the workspace folders. So know I want to commit the program for others, but then the path I put in the program won't work, because the program is running on a different computer. What I need is to be able to use the file with only the path in my workspace. If I just put in the path, which is in

how to get a conf.txt path in eclipse

蹲街弑〆低调 提交于 2019-12-25 11:34:06
问题 I have an eclipse project and in one folder there is a text file "conf.txt". I can read and write the file when I use the path on my Computer. But I have to write my own folders there as well, not only the workspace folders. So know I want to commit the program for others, but then the path I put in the program won't work, because the program is running on a different computer. What I need is to be able to use the file with only the path in my workspace. If I just put in the path, which is in

Reading a text file in Threads to RichtextBox inside Panel

我怕爱的太早我们不能终老 提交于 2019-12-25 10:15:32
问题 I have a windows Form application in which i have created a Panel.I have set the AutoScroll property of Panel True.Inside Panel i have created a RichtextBox.Now as per my requirement i have to read a text file line by line with delay in each line into this RichtextBox.I have taken timer to do this in frmHome_Load event.I have the following code to do this .. private void frmHome_Load(object sender, EventArgs e) { timer1.Interval = 1000; timer1.Start(); } private void timer1_Tick(object sender

Strange EOutOfMemory exception using TStringList

柔情痞子 提交于 2019-12-25 09:32:44
问题 I have a system that loads some text files that are zipped into a ".log" file and parse then into informational classes using multiple threads that each deals with a different file and adds the parsed objects to a list. The file is loaded using TStringList, since it was the fastest method that I tested. The number of text files is variable but normally I have to deal with something between 5 to 8 files ranging from 50Mb to 120Mb in one incursion. My problem: The user can load the .log files

Load a text file when UITableView is tapped

喜欢而已 提交于 2019-12-25 08:14:18
问题 So, I've got an UITableView showing the contents of the app Documents folder. In that folder I have 9 text files called 1.txt, 2.txt, 3.txt and so. I've managed to get the selected row, but now I need to load the txt wich corresponds to the selected file. By example if I touch the 2.txt, the detail view should open what is on 2.txt file. That's the part I don't manage to get working. Thanks in advance :) 回答1: When you select the row the table view delegate method is called: - (void)tableView:

Batch file convert comma delimited to fixed length

ぐ巨炮叔叔 提交于 2019-12-25 07:58:29
问题 How to convert a text file to a fixed length file: Here is my code attempt and the sample text file. del answer.txt @ECHO on @setlocal ENABLEDELAYEDEXPANSION cls set space= set var :: loop through records for /f "tokens=1-6 skip=1 delims=," %%a in (comma3.txt) do ( echo tokens %%a %%b %%c %%d %%e %%f set var=%%a%space%%%b%space%%%c%space%%%d%%e%%f echo var %var% echo %var% >> answer.txt ) endlocal pause Input: 1116559,P1303251287,20130325225906CD,13013822,1,0000 1104220,P1303250282

Batch file convert comma delimited to fixed length

三世轮回 提交于 2019-12-25 07:57:48
问题 How to convert a text file to a fixed length file: Here is my code attempt and the sample text file. del answer.txt @ECHO on @setlocal ENABLEDELAYEDEXPANSION cls set space= set var :: loop through records for /f "tokens=1-6 skip=1 delims=," %%a in (comma3.txt) do ( echo tokens %%a %%b %%c %%d %%e %%f set var=%%a%space%%%b%space%%%c%space%%%d%%e%%f echo var %var% echo %var% >> answer.txt ) endlocal pause Input: 1116559,P1303251287,20130325225906CD,13013822,1,0000 1104220,P1303250282

How do I work out the difference in numbers when reading and writing to text files in python?

本小妞迷上赌 提交于 2019-12-25 04:57:29
问题 Alright, so I am studying python as a hobby, and I need to write a program that: should look at data for each student and calculate the number of marks a student needs to achieve the minimum score when they re-sit their exam. So I am going to say that the minimum score that a user needs to pass their exam is 85, and if a student record says 80, they would need 5. I have written the text file, and started the python code, but I have hit a dead end, any help would be greatly appreciated. Many

Logging in a text file iPhone

柔情痞子 提交于 2019-12-25 04:19:56
问题 I have a score system and I would like to log all scores in a text file separated by line breaks. Here is my current save code: NSData *dataToWrite = [[NSString stringWithFormat:@"String to write ID:%i \n",random] dataUsingEncoding:NSUTF8StringEncoding]; NSString *docsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString *path = [docsDirectory stringByAppendingPathComponent:@"text.txt"]; // Write the file [dataToWrite

Organising and sorting data from a text file

白昼怎懂夜的黑 提交于 2019-12-25 03:49:29
问题 I've got some information stored in a text file based on people taking a test and the scores they have received. Every time they take the test again, a new score is added. The text file looks like this with the data stored within it: Mike 5 7 9 Terry 6 6 9 Paul 4 5 6 I'd like to be able to retrieve the information from the text file and identify the highest score for each person so that it printed out their name and a single number. If I retrieve the data from the file and store it as a list