Questions tagged [txt]

txt is the conventional filename extension of text files.

1467 questions
1
vote
4 answers

How to store .txt file data in different columns of a CSV file using BASH?

I have a .txt file with the following data structure: Scan Times: 33.3 seconds 77.4 seconds 33.3 seconds 77.4 seconds Check Times: 110.30 seconds 72.99 seconds 72.16 seconds 110.30 seconds Move Times: 73.66 seconds 90.77 seconds 72.87…
palacetrading
  • 71
  • 1
  • 11
1
vote
1 answer

Read tab delimited text file in Spark R

I have a tab delimited file that is saved as a .txt with " " around the string variables. The file can be found here. I am trying to read it into Spark-R (version 3.1.2), but cannot successfully bring it into the environment. I've tried variations…
Obie K
  • 157
  • 1
  • 8
1
vote
1 answer

Creating multiple txt files from a text file

I am trying to take the Federalist Papers from Project Gutenberg and convert them into text documents. The issue with Project Gutenberg is that each paper is not separated out - it reads in as one large text file, so I have to tell Python to create…
1
vote
0 answers

How to download an array in txt on JavaScript

Hi im trying to download an array as txt file to use later. The code i Used is the following Html
Javascript: function…
1
vote
2 answers

Search for content segments of one .txt file in another .txt file digit by digit and print matching lines

I have two txt files: file1.txt and file2.txt. File1.txt contains the following: 12345678 File2.txt contains this: 34567999 23499899 13571234 I now want to look at the first 3 digits of line 1 of file1.txt (which are "123"). I now want to go to…
licm
  • 99
  • 8
1
vote
1 answer

Reference a variable that is inside a "with open" block inside a function

def write_lor(): with open("data.txt", 'r+') as filehandle: filecontents = filehandle.readlines() filehandle.seek(0) new = (int(filecontents[0])+1) filehandle.write(str(new)) filehandle.truncate() This is…
OhItsTom
  • 39
  • 4
1
vote
2 answers

Extracting multiline from .txt to dictionary

I am trying to figure out how to code the following problem using python. Suppose we have the following data set in a .txt file: package autoload config core 'main' option Enabled 'no' option StartTimer '120' option RetryTimer '30' …
FlyingFox
  • 13
  • 2
1
vote
1 answer

Creating a JSON with FDDB fold txt files

TL;DR The function is not returning values from all the lines even though I used a while loop The FDDB fold txt files have data formatted as below. First there is the image file path, then the next line has the number of faces, and the following…
1
vote
1 answer

Limiting maximum page numbering and adding Previous and Next button

I am creating a pagination using a text file as database instead of using mySQL. Already finished most of it, the only problem is the page numbering itself. How can I limit the maximum page numbering at the bottom part? And is there anyway to move…
TaigaHyaga
  • 40
  • 6
1
vote
0 answers

Python PDF to TXT local character

I am tring to convert PDF to text file. But the characters which are unique to the language of the PDF file, I mean the ones not in English, are lost in conversion. How can I convert PDF to text without losing any data? Thanks in advance. import…
Anar
  • 23
  • 3
1
vote
0 answers

Pandas txt to csv output only displays the first two lines of values, how do I get the full data to show?

My issue is as follows. I've gathered some contact data from SurveyMonkey using the SM API, and I've converted that data into a txt file. When opening the txt file, I see the full data from the survey that I'm trying to convert into csv, however…
Ak17
  • 13
  • 4
1
vote
2 answers

double quotes pandas.read_csv

I have large txt file with multiple words and chars and I'm trying to read this file into a pandas dataframe, with each word or char in a different row. The problem is that " is one of the chars, and the function reads all the words between two " as…
abc123
  • 53
  • 5
1
vote
4 answers

Summing comma separated ints from a text file and then storing to an array in C++

I was tasked to read 3 rows of 5 comma separated values from a text file, sum up each column, and store the result in an array called bins. I am struggling to read the ints from the text file as they are comma separated. I first need to clarify how…
Consa
  • 11
  • 5
1
vote
2 answers

Know how many txt there are in a directory

i am trying to do a program that check a directory and tell me how many txt already exist so i can write a new one sequentially. What is the best way to do that, and how i do that? Sorry for my poor english
Gomes
  • 11
  • 2
1
vote
1 answer

reading txt file into a data frame, excluding commas and pound

Here is a short sample of my txt file, county-covid-data.txt #County,Confirmed Cases,Probable…
sarsmth23
  • 13
  • 2