txt is the conventional filename extension of text files.
Questions tagged [txt]
1467 questions
2
votes
0 answers
Write txt to Oculus Quest 2 and read it out on PC
I have developed a Unity game that will be used for research purposes. The time that the player needs per level is written in a txt file. On PC it works fine. But I can't find it anywhere when I read the Oculus files with sidequest or android file…

9Ilkp
- 21
- 3
2
votes
2 answers
How to extract data matrix using pandas?
I have a csv file with 6901 rows x 42 column. 39 columns of this file is a matrix of data that I would like to do some analysis on. I do not know how to extract this data from pandas as a matrix which does not need index and treat it as a numerical…

Raz
- 49
- 11
2
votes
1 answer
Ghostscript txt file to pdf
Is it possible to convert txt file to pdf using Ghostscript? I already manage to make it working for jpg to pdf, pdf to txt, but I'm having a hard time to make it working for simple txt files..
So far I tried solutions like:
gswin64.exe -dNOSAFER…

Matt2907
- 29
- 2
2
votes
1 answer
Separating three JSON character and list data in R
I have a txt file of nested JSON data across three main tasks (entering ID information and two behavioural tasks) across several participants. I want to be able to fully flatten this file, and create an excel file at the end with the flattened…

strgrl
- 25
- 3
2
votes
3 answers
Split a string in Python dictionary with two different separators only if the separator exist on the string
I have a dictionary :
{'...': '...',
'unite_fonctionnelle': 'text to keeep',
'...': '...'}
In this case the dictionary is good but sometimes the value of unite_fonctionnelle need to be cleaned, the syntaxe is always the same:
{'...':…

Howins
- 487
- 1
- 6
- 18
2
votes
1 answer
overwriting a specific line in a txt file
i am still new to python, i have tried this way to overwrite a line on a txt file
'''
answer =input("R/S/L/M:")
if answer == "R":
print ("Racer")
f=open('character.txt', 'w+')
with open("character.txt") as file_in:
lines = [1]
…

HRSPX0011
- 45
- 5
2
votes
1 answer
For Julia saving output to txt/CSV file?
I am dealing with output saving using Julia 1.4.2 on Win10, I have tried several ways referred to docs. But nothing works for me.
The output I want to save look like this
julia> sim_result
GpABC.SimulatedABCRejectionOutput(3, 1465, 20000, 1.0,…

Bonjour_Lemonde
- 21
- 2
2
votes
2 answers
Python: Counting words from a directory of txt files and writing word counts to a separate txt file
New to Python and I'm trying to count the words in a directory of text files and write the output to a separate text file. However, I want to specify conditions. So if word count is > 0 is would like to write the count and file path to one file and…

JohnD
- 121
- 1
- 9
2
votes
2 answers
Formating a txt file
I have a TXT file formatting that looks like:
123451234512345
123451234512345
I want to format the file with php in this format:.
12345-12345-12345
12345-12345-12345
This is what I have tried:
$codes = "codes.txt";
$unformatedCode = file($codes,…

OUD
- 23
- 4
2
votes
0 answers
read numpy array from txt file by chunks
I have a 2D array saved in txt file(10 millions rows). Because it's too large, I need to load it by chunk. Let's say read every 1000 lines each time (as a batch size of training data in Neural Network). Now I followed this :
Read specific lines from…

G-09
- 345
- 2
- 13
2
votes
2 answers
Turning .txt file (empty dataframe with all data as column names) into dataframe
I get this output when displaying the contents of a .txt file:
Empty DataFrame
Columns: [[{'city': 'Zurich, Switzerland', 'cost': '135.74'}, {'city': 'Basel,
Switzerland', 'cost': '135.36'}, {'city': 'Lausanne, Switzerland',…

Theresa_S
- 329
- 1
- 11
2
votes
0 answers
How do I use JavaScript's FileReader API to read multiple text documents and add their contents to an array as strings?
I'm trying to use JS to:
Read several .txt files which contain JSON objects as text
Save these text strings to an array (with length equal to the number of files I'm reading in)
Write essentially a long comma-separated list of all the values in…

Connor Brown
- 21
- 1
2
votes
2 answers
how can i print text files without \n in python
open("usernames.txt", "r")
open("passwords.txt", "r")
with open("usernames.txt", "r") as users:
usernames = users.readlines()
with open("passwords.txt", "r") as user_passwords:
passwords =…

tenn
- 27
- 1
- 4
2
votes
0 answers
Eclipse/Python pandas.read-csv - OSError: Initializing from file failed
I know that this issue has been raised in other posts... But I could not find a way to solve my issues reading them.
I am trying to open a ".txt" file using pandas on Eclipse/PyDev.
import pandas as pd
filePath = "/PathToFile/Test.txt" #This is…

Andrea Manfrin
- 45
- 5
2
votes
2 answers
Import txt files with UTF-8 special characters to xlsx
I have txt files that are automatically exported to me from another system (I cannot change this system). When I try to convert these txt files to excel with the following code (I created a subfolder xlsx manually):
Sub all()
Dim sourcepath As…

BertHobe
- 217
- 1
- 14