txt is the conventional filename extension of text files.
Questions tagged [txt]
1467 questions
-2
votes
1 answer
Why is the txt file content erasing itself when i restart the program?
So, im making logs for my discord bot
and when i restart the program the logs are erasing itself (the logs are in a txt file)
Here's the code:
import discord
from discord.ext import commands
from datetime import datetime
from datetime import…

Gacha YTB
- 17
- 1
- 4
-2
votes
1 answer
Python - breaking down the percentage of values and adding new rows to the list
I'm a beginner in python and can't figure out the percentage breakdown of the amount. I would like the rows to contain lines with the calculated amounts.
DATA FROM TXT:
['Date', 'Period', 'NumberBill', 'Amount', 'KEY', 'WHAT\n']
['31.01.2022', '2',…

edith
- 3
- 3
-2
votes
2 answers
Improving PHP website speed: removing mySQL VARCHAR-999 fields, and converting them into text files
I've got a PHP+mySQL website that shows data of 300,000 products: name, description, how to fix it, where to buy it, etc.
Initially, the mySQL table is designed in the following way:
- product_id: MEDIUMINT
- category_id: SMALLINT
- weight_kg:…

Hookstark
- 1,097
- 3
- 11
- 23
-2
votes
1 answer
separate a .txt file into two columns using pandas
I have a .txt file, without header. I am going to separate into two column with header X and Y that is ordered like this:
enter image description here
I have read text file into pandas:
How can I have data frame with two column and header X and…

GISnegarsh
- 3
- 2
-2
votes
1 answer
How to use "for loop" in Python to extract year and firm name (for earning call transcripts) from a txt file
I have a txt file of this type:
Thomson Reuters StreetEvents Event Transcript
E D I T E D V E R S I O N
Q3 2003 ABM Industries Earnings Conference Call
SEPTEMBER 10, 2003 / 1:00PM…

Janz
- 3
- 2
-2
votes
1 answer
create exe using pyinstaller but does not open file
this is my code, i'm trying to convert it to .exe, it works but does not open and read the text files, i did it on MacOs and works well, but does not work in windows
the problem is in this part
def make_house():
try:
server_Adress =…

fatemeh
- 1
- 1
-2
votes
1 answer
How to shuffle questions order when game starts?
How to shuffle questions order when game starts?
I have a working code of a 10 text questions' trivia game with a timer (html, javascript, css). Already studied 1 to get an idea. However, my javascript coding skills are very limited. I would…

NDi
- 184
- 1
- 2
- 17
-2
votes
1 answer
how to add custom download button in html?
Java script:
var x = 'demo'
I want a html button from which we can download x as anyname.txt in which the value should be demo

Gunnu Mittal
- 12
- 2
-2
votes
1 answer
Replacing all spaces with underscores in a text file with unix
Sorry if this is a repeat question; I am very green with unix.
I have several (n = 12) text files that contain spaces in the first column that should all be changed to underscores. The files are of phylogeny ID and counts in different samples, see…

Geomicro
- 303
- 3
- 13
-2
votes
1 answer
ifstream unable to load in two or more files correctly [C++]
I'm making an "Identity generator" where the computer randomly picks lines from .txt files.
Although it works fine with the first part of the code, when I repeat that code and change the variables it still uses the old txt file.
Expected…

Tetie
- 365
- 1
- 14
-2
votes
1 answer
Using the first two integers as the dimensions of the Array
I'm supposed to take the first two integers from a txt file and create an array using them. Here is the txt file that was given to me.
5 is how many rows are in the array. 6 is how many columns are in the array. I started off with just trying to…

pnrgl
- 7
- 2
-2
votes
3 answers
How do i find an index of x,y from the txt file in c#? Snake game
Here is my txt file and i need to get x,y of O
####################
# #
# #
# #
# #
# #
# #
# O #
# …

808thlife
- 9
- 3
-2
votes
3 answers
Unable to open the file in txt in python
I have difficulty importing this file so that I can use it any help would greatly be appreciated.
import os
path = os.path.abspath(r'C:Users/kariwhite/Desktop/430 Python/week 4/cars.txt')
cars=open(path)
print (cars)
for line in cars:
values =…
-2
votes
1 answer
how to close this file to rename and delete a file("Stream closed")
Hi I am having trouble deleting and renaming my file this is because my file is still open but when I try to close my file I then get a stream closed which means my file is closed, my question how do I get my code to delete and rename my file even…

chris
- 13
- 3
-2
votes
1 answer
how to slide all the columns name in a dataframe to the left?
I have a dataframe (25000, 20000). The original format is like this
I would like to make it become like this
by using python. Can anyone give a help?

thdk13
- 1
- 2