txt is the conventional filename extension of text files.
Questions tagged [txt]
1467 questions
1
vote
2 answers
How to read a list of dicts from a txt file?
I would like to read this txt file and get a list of dictionaries in python:
data.txt:
[{"name": "Aaron", "age": "1"}, {"name": "Bruce", "age": "2"}]
Whereas:
with open('data.txt','r') as f:
list_of_dict =…

Tangobones
- 25
- 4
1
vote
1 answer
Powershell - SaveFileDialog creates txt file temporarily
I want to create a GUI in Powershell where the user selects a path to save an empty txt file. For this I use SaveFileDialog. When I run the code below, the file is created temporarily. It is not saved permanently. What do I need to change?
Function…

muechaid
- 13
- 2
1
vote
0 answers
Iterate the txt files in several subfolders under the folder
I am new to R. I have several txt. files in several sub-folders under one folder. The structuer of the txt files are the same.
I would like to iterate the files for each sub-folder and generate a signle file for the whole folder.
I coded as…

Heiwa
- 41
- 4
1
vote
1 answer
Read .txt file into pandas dataframe
I have a .txt file. The format is like this:
12:12 {"name": "alice", "id":"1", "password":"123"}
12:14 {"name": "bob", "id":"2", "password":"1fsdf3"}
12:18 {"name": "claire", "id":"3", "password":"12fs3"}
I want to convert it to a pandas…

jds
- 59
- 4
1
vote
1 answer
Python replace txt data with csv data
I have two files, one is text file and the other is a csv file.
The text file has a string format like this
To: {email}
From: noreply@deals.com
Subject: Deals!
Hi {first_name},
I want to replace email and first_name with some data I have…

Mahmoud Faisal
- 11
- 4
1
vote
2 answers
How to save pandas dataframe as a txt file in Python?
Let's say I have text data in a pandas data frame with multi-label.
Text Label
0 I love you A, B
1 Thank you C, D
2 You are welcome A, B, C
I wanted to convert it to a text file, where each row is the sentence…

Jaya A
- 145
- 1
- 8
1
vote
0 answers
Is there a way to add to a file and read it to run different scripts?
I would like to know if there is a way to use a .txt file and write numbers (0-9) after running a script. After each script execution the script would read the file and determine what other script to execute based on the number in the file. Is…

Tyler Slade
- 9
- 2
1
vote
2 answers
C++ Reading txt directly into a custom vector that should be grouped accordingly to the struct by each line
I'm working with a custom vector, and currently the code looks like this:
struct Edge {
int source, dest, weight;
};
int main()
{
// initialize edges as per the above diagram
// (u, v, w) represent edge from vertex `u` to vertex `v`…

Patryk Piwowarczyk
- 97
- 6
1
vote
1 answer
Isolate lines that dont exist in txt file
I have two text files that have camera models, however not all models on one text file are present in the other, so, I want to find the missing models. One issue tho, some models have extra strings in their name e.g., :
NIKON D610
D610
CANON…

NBG
- 30
- 7
1
vote
1 answer
Grouping specific tasks for various users from a txt. file in python
I have a task where I have to create a summary of each users tasks which are listed in a txt file. For example the summary must include how many tasks are assigned to each user, how many have been completed, how many are overdue etc. I figured out a…

Tdog
- 21
- 4
1
vote
1 answer
Powershell: Converting Headers from .msg file to .txt - Current directory doesn't pull header information, but specific directory does
So I am trying to make a script to take a batch of .msg files, pull their header information and then throw that header information into a .txt file. This is all working totally fine when I use this code:
$directory =…

Sound Therapy
- 13
- 2
1
vote
0 answers
script to process a list of ip addresses from a txt file and then confirm whether they are accessible or responding IPs within a xlsx file
I would like to be able to python script to process a list of IP addresses from a txt file and then confirm whether they are accessible or responding IP Addresses within a excel file.
I have seen the following, which I have used as a base but it…

Benjamin Hirst
- 19
- 4
1
vote
1 answer
Convert multi-fasta file into seperate individual fasta files in R
I have a multi-fasta file with 1333 individual fasta files in txt fomrat
>header1
ACGATGCACAAGGT.....
>header2
CCAAACGCAGGGGT.....
>header3
CCAATAAGTAGCCC.....
>header4
AAAGTCGGATTTAG.....
continuing till >header1333
I want to split the multi-fasta…

08BKS09
- 105
- 6
1
vote
1 answer
Join separator in R fread shell command
I have two .txt files that I want to join using the R data.table fread function's shell command feature as a pre-processing step before importing into R. The two files…

jimmychevrolet
- 15
- 2
1
vote
1 answer
Creating a neat csv file by filtering data and unnecessary information from a txt file
I have an assignment to export neat CSV files where only the headers and data are present, all other data must be filtered out. There are about 500+ text files.
Each file must be a separate CSV file, the format must be "YEAR-MONTH-DAY…

Shradda
- 21
- 2