txt is the conventional filename extension of text files.
Questions tagged [txt]
1467 questions
1
vote
1 answer
read from txt file and convert into dataframe in python
I have a txt file as following:
sub_ID: ['sub-01','sub-02']
ses_ID: ['ses-01','ses-01']
mean: [0.3456,0.446]
I want to read this and convert it to a dataframe such as in the image -don't mind the values in mean_e_field column, it's just an…

gulo1221
- 13
- 3
1
vote
2 answers
How to scrape HTML from TXT and store all items to CSV?
I am trying to export tag items from HTMLon a TXTfile. For some reason my code is only taking the last line and exporting it to the CSV. It won't scrape the other listed items. Not sure why. I tried multiple solutions but nothing.
Here is my…

sammyb62
- 5
- 4
1
vote
0 answers
Python - using data from multiple lines in a txt file
I'm on a coding course and am struggling with a task.
I have a txt file that I'm importing data from (in this case usernames and passwords). The first line (and only provided to start with) is:
admin, adm1n
Logging in with this is fine. Once I've…

mandykg
- 33
- 4
1
vote
2 answers
np.savetxt tab delimited txt file
I have a dataframe that needs be txt file. So, I use np.savetxt method. However, dataframe consists of four columns which are string, string, string and integer, respectively.
np.savetxt takes fmt and delimiter parameters. In official document, it…

Bengu Atici
- 17
- 3
1
vote
1 answer
Splitting sentences from a .txt file to .csv using NLTK
I have a corpus of newspaper articles in a .txt file, and I'm trying to split the sentences from it to a .csv in order to annotate each sentence.
I was told to use NLTK for this purpose, and I found the following code for sentence splitting:
import…

Tess
- 15
- 3
1
vote
1 answer
Going crazy cause I can't set up a DKIM
Hope to find a solution here.
I use lemlist to send automated e-mail, and it requires me to set up a DKIM, DMARC and SPF. My e-mail provider is 1and1.com (Ionos).
I did set up a DMARC and SPF record, but still can't make a DKIM, although I followed…
1
vote
0 answers
Is There a Way to Make a Java Method that Opens a .txt File as a pop-up?
I am currently making a java project that simulates a website for swimmers. It has multiple classes and incorporates the Jswing GUI. I have buttons that are used to display other classes GUI and data, but I was wondering if there was a way to have…

TvonH
- 19
- 1
1
vote
1 answer
bash - Concatenate files in different subfolders into a single file and have each file name in the first column
I am trying to concatenate a few thousand files that are in different subfolders into a single file and also have the name of each concatenated file inserted as the first column so that I know which file each data row came from. Essentially starting…

vanish007
- 323
- 1
- 10
1
vote
1 answer
Javascript use match() to select an entire paragraph
I'm trying to extract an entire paragraph from a txt file using JS, then put it to an html element. I've read quite a few posts already and articles, but I can't get the right regex formula. This is an extract of the txt file:
Doing initial required…

sigfried
- 49
- 1
- 6
1
vote
2 answers
How do you pull specific information out of a text file? Python
Here is an example of some of the information in the text file:
Ticker : Ticker representing the company | Company: Name | Title: Position of trader | Trade Type: Buy or sell | Value: Monetary value
Ticker : AKUS | Company: Akouos, Inc. | Title:…

Gamer
- 45
- 5
1
vote
3 answers
Sed command to delete characters on specific location?
I have this sed command which add's 3 zero's to an id (this occurs only if the id is 13 characters long):
sed 's/^\(.\{14\}\)\([0-9]\{13\}[^0-9]\)/\1000\2/' file
My input looks like this:
A:AAAA:AA: :A:**0123456789ABC **:AAA:AAA : …

Luis Meléndez
- 23
- 7
1
vote
3 answers
Convert txt file to csv, separation specific lines to column
I am currently try to have the data like this (The ... just means there are more lines, no need to post the entire file here.)
376 932
noms sommets
0000 Abbesses
0001 Alexandre Dumas
0002 Alma Marceau
...
0375 Étienne Marcel
coord sommets
0000 308…

Beam291
- 98
- 7
1
vote
3 answers
How to get the real number after a string in a file
I have files that contain both strings and floats. I am interested in finding the floats after a specific string. Any help in writing such a function that reads the file look for that specific string and returns the float after it will be much…

AbuStack
- 39
- 5
1
vote
3 answers
Fill in matrix from .txt file in Java
I am trying to read a .txt file with a certain format and fill it into a matrix in Java.
The text file has following format:
123
456
I have the following code, that creates the matrix based on the .txt file with the right dimension(2 rows, 3…

Karim Abou El Naga
- 111
- 10
1
vote
1 answer
Seeking and deleting elements in lists of a parsed file and saving result to another file
I have a large .txt file that is a result of a C-file being parsed containing various blocks of data, but about 90% of them are useless to me. I'm trying to get rid of them and then save the result to another file, but have hard time doing so. At…

Redal_Snake
- 57
- 6