Questions tagged [txt]

txt is the conventional filename extension of text files.

1467 questions
1
vote
1 answer

How to read.txt into array in React Native

I am trying to load data from two separate .txt files into two different arrays, I have also tried loading in the data from .csv files. I am getting empty arrays as the result. Here is my code: loadData = async () => { var reader = new…
1
vote
1 answer

How to read after a space until the next space in Python

I have this program: import sys import itertools from itertools import islice fileLocation = input("Input the file location of ScoreBoard: ") input1 = open(fileLocation, "rt") amountOfLines = 0 for line in open('input1.txt').readlines( ): …
vapouryh
  • 41
  • 6
1
vote
3 answers

How to copy the whole txt file to Excel

I have a code which doesn't completely work: Sub Import_TXT() Dim FileToOpen As Variant Dim OpenBook As Workbook Application.GetOpenFilename ("Text Files (*.txt), *.txt") If FileToOpen <> False Then Set OpenBook =…
Eduards
  • 68
  • 2
  • 20
1
vote
1 answer

end of line issues reading txt file in R

I am having some issues reading a txt file in R that I presume is created by end of line issues. I have a dataframe that contains two columns: the first column contains a label in the form __label__1234 and the second column is a string of text (I…
astel
  • 192
  • 7
1
vote
1 answer

Stata: importing txt with several multi character delimiters

I have data with very odd delimiters: 1,|ABC1|,|BUD|,|Fed Budget & Appropriations|,|t1| 2,|ABC2|,|LBR|,|Labor, Antitrust & Workplace|,|t2| 3,|ABC3|,|UNM|,|Unemployment|,|t1| So the delimiter is a comma and each variable, but the first one (the…
ArOk
  • 193
  • 7
1
vote
1 answer

Finding minimum, maximum and range of character count in every line of a TXT file

I have a text file and I need to count the number of characters per line and then print the minimum, maximum value and range. Example (txt file): lzaNDDRipfohkALungYAipuOhbWIpkmsSqvXkjRYNxCADTUKzS aQLi DwhhJfvUd The output should be: Min: 4…
ny123
  • 31
  • 5
1
vote
0 answers

Error message: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 3131: invalid start byte

I am a newbie in programming and have a question: I try to edit some .vtt files, where I want to remove certain substrings from the text. The file should keep its structure. For this, I copied the .vtt files in the folder and changed it to a .txt…
Ina N.
  • 11
  • 2
1
vote
1 answer

Dictionaries/list: Creating a function that prints "name of student" if student has completed all "five tests" with a "grade" >= 2?

This is my programming task: The file "grades.txt" contains data about the tests taken by students and the achieved grade. Each line in the file contains the name of the student, the test the student took, and the achieved grade. You can assume that…
Emil
  • 11
  • 2
1
vote
1 answer

How can I transform a hdf5 file into a text file?

have been trying to read an .hdf5 file so that I can plot some of the data, to do so I thought I would take the data in the .hdf5 file and process it into a .txt file. To check the data I ended up using the code presented in reading nested .h5 group…
user7077252
  • 135
  • 6
1
vote
3 answers

python list to .txt file, quotation marks disappear

I have a python list similar to this: my_list = ["hello", "bye", "good morning", "good evening", , "'yes", "''no'"] Note that there may be some weird combination of quotation marks within a string. I want to output it into a text file, however the…
Exa
  • 466
  • 3
  • 16
1
vote
1 answer

convert text file to shapefile with python

I have a txt file that contains 5 columns(ID number,city,latitude,longitude,altitude) with tab delimiters. I want to convert this txt file into a shapefile format with python. I am a beginner in python and i do not know how to do this. Can anyone…
George
  • 31
  • 1
  • 4
1
vote
1 answer

hello,PLease help me with txt.in Python

have to write in python 2 txt.files one is input of numbers: writen in 2 lines 4-1 and 12-3 I have to make the subtraction and write the result to other txt.file please help me I am very green to python, just started to learn it. Thanks you all in…
Do Creed
  • 11
  • 1
1
vote
0 answers

how to import .txt database to mysql?

how to import .txt to mysql file? I have a .txt file with hundreds of records and I want to import it into the mysql database table. my txt file database is like that: {"PAGE ID":{"title":"PAGE TITLE","description":"PAGE…
İlteriş
  • 11
  • 1
1
vote
1 answer

Why does .txt file in Java always become empty when I run the program?

I am trying to read in a .txt file which acts as a database from my Java program. I have written to the file before running the program via TextEdit and using Java FileWriter class but the program remains to show an empty array after running these…
Andy
  • 11
  • 1
1
vote
2 answers

Printing multiple solved Sudoku arrays to a text file

Having some issues with a print to .txt function. There are a lot of options available, and I've tried several methods, but I'm running into errors. I've created a Sudoku solver that reads an amount of 9×9 arrays from a text file and solves all of…
Ian
  • 41
  • 3