text-files

Parsing through text file with C++

拜拜、爱过 提交于 2019-12-12 04:38:02
问题 I am trying to figure out the best way to read in numbers from a text file and set these numbers to variables. I am having trouble because there will be multiple text files that will be testing my code and they are all of different lengths and sizes. A sample test one looks like this: 0 (1,3) (3,5) 1 (2,6) 2 (4,2) 3 (1,1) (2,4) (4,6) 4 (0,3) (2,7) Where the first number represents a vertex on a graph, the first number in a coordinate is the vertex it is going towards in a directed graph, and

XML Convertion to CSV

[亡魂溺海] 提交于 2019-12-12 04:32:36
问题 <?xml version="1.0" encoding="UTF-8"?> <FirstTag version="1.0" createTime="15:59:59" DATE="20161209"> <SecondTag Name="House01"> <a> <Furniture FURN_ID="FUR00001" FURN_AMT="2" price="10000"/> <Furniture FURN_ID="FUR00002" FURN_AMT="1" price="20000"/> </a> <b> <Furniture FURN_ID="FUR00001" FURN_AMT="2" price="30000"/> <Furniture FURN_ID="FUR00003" FURN_AMT="1" price="40000"/> </b> <c> <Furniture FURN_ID="FUR00002" FURN_AMT="2" price="50000"/> <Furniture FURN_ID="FUR00003" FURN_AMT="1" price=

Is it possible to filter a TextFile in listview in C#

Deadly 提交于 2019-12-12 03:48:33
问题 For example the value in my Textfile 1.Description=DATABASESECRIPTION1 1.name = TEST1 1.age = 18 2.Description=DATABASESECRIPTION2 2.name = TEST1 2.age = 14 3.Description=DATABASESECRIPTION3 3.name = TEST1 3.age = 18 i only wanna see 1.Description=DATABASESECRIPTION1 2.Description=DATABASESECRIPTION2 3.Description=DATABASESECRIPTION3 and i only wanna show the value of description in a textfile how can i do this ? How can i filter this. my code Stream mystream; OpenFileDialog openFileDialog =

Android - Strings.xml versus text files. Which is faster?

不问归期 提交于 2019-12-12 03:44:47
问题 I have a dictionary database which contains a total of 99,833 words but separated per letter. I am testing dictionaryA.txt which contains 3922 words. Case 1: When I enter a word I wanna look up, lets say "abacus", Using a buffered reader, My app says "Thesis is not responding. Wait - Quit". If I choose wait, it will return the word abacus and its definition. CODE: InputStream inputStream = getResources().openRawResource(R.raw.definitiona); try { BufferedReader in = new BufferedReader(new

Generated JAR file is not executing

懵懂的女人 提交于 2019-12-12 03:42:30
问题 I have a java project which reads data from an the excel sheet (specified by the user), performs some filtering and creates a few text files and then writes the modified data to the text files. The project is working fine and now I want to create a jar file for it. I created the jar file but it did not run. As far as the code is concerned it is running without any errors.I have used Netbeans for GUI. I also saw related questions which said it is not possible to create a text file from a

Load List From Text File To Bash Script

牧云@^-^@ 提交于 2019-12-12 03:29:47
问题 I've a .txt file which contains abc.com google.com .... .... yahoo.com And I'm interested in loading it to a bash script as a list (i.e. Domain_List=( "abc.com" "google.com" .... "yahoo.com") ). Is it possible to do? Additional information, once the list is obtained it is used in a for loop and if statements. for i in "${Domain_list[@]} do if grep -q "${Domain_list[counter]}" domains.log .... .... fi .... let counter=counter+1 done Thank you, Update: I've changed the format to Domain_list=(

Python Write to Text File Dictionary Shows incorrect information

寵の児 提交于 2019-12-12 03:25:41
问题 I'm currently testing my code to see if it functions properly, and therefore remove any inconsistencies. First of all, the code is below: user_name = str(input("What is your name?")) last_name = str(input("What is your surname?")) final_total = int(input("What is your total score?")) with open('quiz_results.txt') as f: for line in f: name,val = line.split(":") user_scores[name].appendleft(int(val)) with open("quiz_results.txt", "a+") as f: f.write('{}:{}\n'.format(user_name + last_name, final

Read only a fixed column width in a text file in C

穿精又带淫゛_ 提交于 2019-12-12 03:16:33
问题 Let's say I have this text file data.txt : |-- 20 characters--||-- 20 characters--| Carlos Rivera Bernal Thomas James Hanner James Patrick Sullivan Brayan Williams Khaterine Smith Ben Thompson How could you read a text file with only the first column of fixed width. After storing each row in that column into a variable and use it as a parameter to a function. 回答1: If your lines were consistently padded to 40 characters plus newline, you could use %20c to read each 20-character field. That

script that pulls data from a txt file in the where clause

瘦欲@ 提交于 2019-12-12 03:15:17
问题 I am trying to write an sql script in toad for oracle version 9.5 that when run will allow the user to select data from a txt file from the c drive where the parameters / variables are entered. The version of oracle is 10g 回答1: Sounds like an Oracle external directory is perfect for the job. Keep in mind this approach is fraught with difficulties if this is a text file that users can write to. Users will do a hundred things you never believed possible that will cause errors and more. From the

Inner While Loop only run once

走远了吗. 提交于 2019-12-12 03:14:49
问题 The purpose of the code is to find a portion of a string (from one document) in a long list of strings (another document), and return the results to a list. I have two while loops, one nested in the other. The outer loop reads each line of that document, and the inner reads each loop of its document. For some reason, the inner while only runs once (for the outer loop's first iteration). Can you explain why and how I could fix it? It seems like it only reads all the lines once and then doesn't