Questions tagged [txt]
txt is the conventional filename extension of text files.
1,025
questions
-1
votes
0
answers
26
views
How do i write multiple columns to a txt
Currently when i write to the txt file it writes one column of the data but then over writes it when new data is passed in. I am trying to write a new column for each instance of data that I pass in.
...
0
votes
3
answers
31
views
How to delete empty line from txt file after replacing it
Lets say I have a txt file that goes like this:
Line 1
Line 2
Line 3
a = input("text to delete from file: ")
with open('save.txt', 'r') as file:
text = file.read()
with open('save.txt',...
0
votes
1
answer
51
views
Read text file, then store lines in array to filter out certain strings
I'm currently trying to read a text file, and store the lines in an array. I then try to filter out certain words with strstr. I'm getting no output when trying to print elements of the array, and the ...
1
vote
1
answer
27
views
python_transform values into array of 0 and 1
I have an issue. I don't manage to find a fast algorithm to put a set of integer values in an array of 0 and 1. For example, this is a portion of the txt file of the exercise:
magazzino n. 0 venditori ...
1
vote
1
answer
43
views
display ";" separated values in table format with python
I'm having the following function which picks results from a results.txt file and displays it to the user, the first row comes out nicely but the rest of the results are not well-aligned. I'm not sure ...
1
vote
1
answer
28
views
Grep on a file to find a string between two words
I have a file named varout.txt, which contains a text as given below:
Message: unable to locate element
I have used the below command to fetching the text between the word Message and element:
result ...
-4
votes
0
answers
31
views
I am trying to get the file to save as the variable (FinalGrade) [closed]
This is the error message i recieved
Hey, When I run the code the first part works, however I am having trouble getting the variable "FinalGrade" to get saved into the file, it give me an ...
0
votes
0
answers
32
views
How can I create .exe with modifiable .txt dependencies
How can I create .exe with modifiable .txt dependencies (sources, dictionaries) from JavaFX program? I want to modify dependency's content in the future.
I tried Launch4J, but I dont find any options ...
0
votes
0
answers
20
views
.txt file filter for a specific HEX snipet
I have a .txt that i want to import into excel to plot the values converted from hex. The textfile is much larger (up to 40000 lines) so doing it manually is not an option.
here is an example of the ....
-1
votes
2
answers
47
views
Tail and search in txt file
I need to make a search on a txt file. Originally I've thought to open the file and search for the word I'm looking for on the last line
remote_file = sftp_client.open('file.txt')
try:
lst = ...
1
vote
2
answers
25
views
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", &...
0
votes
2
answers
21
views
Why is hashmap not counting repeat values(JS)?
So I'm trying to count the number of times an object repeats in an array of objects.
Here is the what the array looks like:
[{ Title: 'Einstein', Author: 'Walter Isaacson' },
{ Title: 'The Elegant ...
1
vote
1
answer
31
views
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 ...
0
votes
0
answers
14
views
How to convert the txt file to tmx file using python
I scraped some contents from the websites and stored them using the txt format. I want to convert the txt file to the tmx file but only find the reverse way. Is there any method that I can convert a ...
-1
votes
2
answers
22
views
convert txt with empty lines in csv
I have many files like the following:
cat test.data
name1
...
nameN
title1
...
titleM
abstract1
...
abstractO
ID
where the numbers N,M,O differ from file to file. But in all files the fields are ...
1
vote
0
answers
25
views
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 ...
1
vote
1
answer
40
views
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", &...
-1
votes
1
answer
54
views
Extract a chunk of text from a .txt file (Python) [closed]
I have a text file that contains 4 parts that I want to extract. I managed to get 3 of them but am struggling with the last one as it has a different marker. Can anyone please help me out. below is a ...
0
votes
1
answer
38
views
Use Python to build a dictionary in a txt file by writing key/value pairs to it over time
How can I "build" a dictionary within a txt file using Python, over time?
I need to take two variables, for example...
some_string = "Hello, World!"
some_float = 3958.8
...then ...
0
votes
1
answer
16
views
txt file doesn't read from start after first loop run
I've two lists, backedup.txt and current.txt.
backedup.txt contains these lines;
Chris_Jamaica.mp3
Chris_Take_Me.mp3
Chris_You_Are_Me.mp3
Chris_Dance_With_Me.mp3
Chris_Yesterday.mp3
current.txt ...
-1
votes
1
answer
39
views
Convert text file data into a dataframe
I have a dataset like this, a .txt file
للہ عمران خان کو ہماری بھی عمر لگائے ہم جیسے تو اس ملک میں اور بھی پچیس کروڑ ہیں مگر خان آپ جیسا تو یہاں دوسرا نہیں ۔۔۔ اللہ آپکی حفاظت فرمائے آمین
[Real,...
0
votes
0
answers
20
views
Plot 3D surface (colormap) in python
Is it possible if we plot a 3D surface (colormap) in Python (matplotlib) from many text files?
I have many txt file, each have x , y and z colomn. How can I plot 3D colormap surface by using ...
1
vote
1
answer
66
views
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 ...
0
votes
1
answer
23
views
Apache Camel - Array of key/pair lines to object
I have a TXT file with user data separated by blank lines
Name : Daniele
City : Genoa
Country : Italy
Name : Giada
City : Milan
Country : Italy
I'm trying to convert that in POJO and eventually in ...
0
votes
0
answers
27
views
Saving a list of txt files into excels python
I have some txt files and I want to write each txt file into a sheet in excel, each txt file has one sheet. I didn't find the answer for that (if you have a solution, i'll thank you so much) so I ...
0
votes
2
answers
51
views
Looping through values in an API and saving to a txt file
I am using a Pokemon API : https://pokeapi.co/api/v2/pokemon/
and I am trying to make a list which can store 6 pokemon ID's then, using a for loop, call to the API and retrieve data for each pokemon. ...
0
votes
2
answers
28
views
How to selectively open lines in a txt file
I have a txt file called song.txt and want to print out all the lines in the file which contain a certain word. I have tried using an if statement and am getting no output. Could anyone point me in ...
0
votes
0
answers
28
views
How to extract metadata from docx, txt and rtf files in Android
Please suggest how it is possible to extract metadata like author, title, creator, creationDate, etc. from docx, txt and rtf file types in Android?
0
votes
1
answer
28
views
Importing and transforming txt file into a csv using R or Excel
I have very little experience with transforming txt data except for very basic transformations and I have been trying for about an hour now to get somewhere using Excel power query and Tidyverse in R.
...
0
votes
1
answer
22
views
Can we append a text file with punctuations in ahk?
I am trying to append a txt file with punctuations to text to a file in AHK but it seems to break the line even if i use round brackets. How can I append to a file without breaking it?
...
-1
votes
0
answers
47
views
how do I add text an txt file using JavaScript in an html application? [duplicate]
I am making an HTML application, but I have a problem.
The issue is that I figured out that I can't use console.log(), so I am using a text file instead. I just don't know how to make the computer ...
0
votes
4
answers
78
views
Delete duplicate lines from text file based on column
I have a txt file that contains over 100,000 lines with header column fields that are separated by tab, and it contains duplicate entries. Now I would like to delete those duplicate entries by either ...
0
votes
0
answers
12
views
how we manually convert xml object coordinates(x-min,x-max,y-max,y-min) into txt file coordinates x,y,w,h
I want to run yolov5 model on custom dataset, but when I convert the XML into text file its not draw a box in the correct place (on objects). So check my conversion point, so kindly tell me How we ...
0
votes
1
answer
35
views
How to save these elements read from a .txt file into an array/matrix in python
I have a .txt file that contains elements that look like this:
Smith 25 35 NC
Johnson 12 4 OH
Jones 23 14 FL
Lopez 2 7 TX
And I want to read the .txt file line by line, and save each of the elements (...
1
vote
2
answers
42
views
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 ...
0
votes
1
answer
31
views
How do I split a line down further in Python txt files?
I am trying to split a line down into smaller elements
Each line contains the birds' name and the number of times it has been seen. I am trying to display them both if the name matches but I can't ...
1
vote
0
answers
31
views
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 ...
-1
votes
1
answer
22
views
Convert RDF files into TXT?
Any ideas about software or methods to convert RDF into TXT?
I have many different file into rdf format and I am looking for a converter?
All the best.
0
votes
0
answers
14
views
How to write .txt file in for loop [duplicate]
I have the following tuple:
companies=('Microsoft', 'Berkshire Hathaway', 'Apple')
In a for loop I would like to create an empty text file for each of the companies given in the tuple companies. The ...
-1
votes
0
answers
17
views
Print Json to File, Error, Alternate method? [duplicate]
I am trying to print this json file to to txt. Is there a different method perhaps? I only need the data under "node" and each "node" would be a new line.
import json
# Opening ...
-1
votes
1
answer
24
views
Compare lines in TXT file to excel file name in a directory using python [closed]
I have a TXT file which consists of names. I wanted to compare line from txt file to excel file name in the directory. Ex: TXT file name contains
Johny
Wick
Rick
I wanted to compare first line in TXT ...
0
votes
2
answers
31
views
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) ...
-1
votes
1
answer
18
views
Writing a list to a txt file with Python and AWS lambda
I am developing a lambda function that needs to write each element of a list 'my_list', in a line of my 'upload.txt' file.
I have used the next code :
my_list=['hello', 'world', 'good', 'morning']
...
1
vote
1
answer
16
views
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 ...
-1
votes
0
answers
59
views
file_get_contents(1): failed to open stream: No such file or directory in... I am sure that the path is correct
I am trying to make a basic character sheet for my D&D campaign. It is part of a larger database of these same kind of pages. I want to make a text box that stores all my notes without having to ...
0
votes
0
answers
34
views
Variable declared in text file not defined for ansible tasks
I have a text file myfile.txt with following code in it
---
my_variable: my-value
Then I have some ansible scripts which uses this variable
Following is the directory structure of these files
...
0
votes
1
answer
41
views
content from multiple txt files into single excel file using python
If I have for example 3 txt files that looks as follows:
file1.txt:
a 10
b 20
c 30
file2.txt:
d 40
e 50
f 60
file3.txt:
g 70
h 80
i 90
I would like to read this data from the files and create a ...
-1
votes
1
answer
58
views
Correct way to limit document read in C without !feof, document error cannot read the .txt
I've been doing this C program which requires reading .txt files and so on. I've been warned so many times by the community about avoiding !feof as loop parameter to define stop reading the files. I ...
0
votes
0
answers
13
views
SSIS - Output contents of CSV to a text file with padding and no column headers
I have a CSV file that's produced every morning, containing call data. I need to process this file into a particular format to import into another system. I've Googled around for a few hours but can't ...