Category : text-files

I was following along a video on youtube https://www.youtube.com/watch?v=lR90cp1wQ1I that goes into reading from a text file and displays it in a GUI tkinter app by breaking it down into a list. I am working on something similar, and I am starting to think maybe this isn’t the right way to go about it. My ..

Read more

I have a file out_92.csv, and I want to count which numbers are higher in the second column of ‘receiving phone’ and how many of those numbers. calling phone;receiving phone;date;price 92;31;2020-04-24;0 92;84;2021-01-19;19 92;31;2020-03-28;9 92;36;2021-01-15;11 92;31;2020-12-13;3 92;35;2020-09-07;16 92;97;2020-07-01;9 92;31;2020-05-20;16 92;31;2020-09-03;13 92;56;2020-06-26;5 92;31;2020-02-25;10 92;17;2020-10-05;7 92;93;2020-07-14;7 92;84;2020-05-13;13 92;31;2020-05-27;12 92;45;2021-01-07;8 92;31;2020-07-18;16 92;74;2021-01-16;1 92;68;2020-08-22;13 92;31;2020-11-03;12 92;75;2020-02-19;16 92;82;2020-10-02;13 92;41;2020-03-06;17 92;43;2020-10-09;13 92;31;2020-12-14;17 ..

Read more

I have an input.csv file, and I want to copy only those lines in which calling phone is 92 to the output.csv file. this is what input.csv looks like calling phone;receiving phone;date;price 49;45;2020-11-08;12 65;39;2020-06-21;8 40;35;2020-01-10;4 28;56;2020-07-19;10 46;68;2020-08-22;14 65;92;2020-05-28;1 11;12;2020-07-11;11 70;76;2020-02-16;15 92;88;2020-04-24;0 92;84;2021-01-19;19 45;76;2020-03-17;11 78;67;2020-08-11;2 Source: Python-3x..

Read more

This is the code I have so far. It lower-cases each word in the input file but I am unsure how to check and remove special characters, except for apostrophes, from the input file. input("Please enter a file name: ") with open(input(), ‘r’) as input_file: for line in input_file: for word in line.split(): word.lower() Source: ..

Read more

I want to print the content of multiple command line arguments (text files) on the same line, with a space separating them from one another. This is the code that I’ve written: from sys import argv, exit if len(argv) < 2: print("Missing command-line argument") exit(1) argumentList = argv[1:] for arg in argumentList: with open(arg, "r") ..

Read more