Questions tagged [txt]

txt is the conventional filename extension of text files.

1467 questions
-1
votes
1 answer

Is it possible to save the results of the "google" package to a txt file in python?

Link to program: https://replit.com/@MichaelGordon5/DetailedSearch#main.py I've coded a program that in essence, does an advanced google search, and Im planning on adding more to it later. It uses the google search package The issue I'm having with…
Deepfake Cake
  • 37
  • 1
  • 5
-1
votes
2 answers

Read a .txt file memory efficient in Python

I'm reading some .txt files as lists, using this method: with open('../Results/DIMP_1120.txt', 'r') as f: DIMP_1120 = list(csv.reader(f, delimiter="|")) with open('../Results/DIMP_1121.txt', 'r') as f: DIMP_1121 = list(csv.reader(f,…
-1
votes
1 answer

Reformatting a txt file with characters at index positions using python

Very newbie programmer asking a question here. I have searched all over the forums but can't find something to solve this issue I thought there would be a simple function for. Is there a way to do this? I am trying to reformat a text file so I can…
-1
votes
1 answer

How to pull information from .txt and import it to Java to be used to create an object

So I have a list of employees.txt files. How do you create a constructor for the object of class employees? The employees object have to have a rank, id, age and name, all of which the information is stored in this .txt file. How do I create a…
-1
votes
2 answers

how to find consecutive number from a txt file using nested loop in python

I would like to find out 6 digit consecutive numbers from a txt file so do I have do first do a list like :['012345', '234567', '345678', '456789', '567890', '678901', '890123'] if I want to find that in the txt file? txt…
Lemon
  • 3
  • 3
-1
votes
1 answer

extract mail content to txt file

class Hotmail: def __init__(self, username, password): self.browser = webdriver.Chrome() self.username = username self.password = password self.emailsender = [] self.emailcontent = [] def…
eyup.tatar
  • 75
  • 8
-1
votes
2 answers

How to round all floats in a text file using Python

Imagine you have a textfile input.txt containing text and floats, but without a regular structure (such as header, .csv etc.), for instance : Banana 1.4030391 (4.245, -345.2456) 4.245 -345.2456 Hello how are you? Based on this file, you want to…
Karlo
  • 1,630
  • 4
  • 33
  • 57
-1
votes
1 answer

Upload txt file using PHP into database and then return Excel file

What I need to do is upload txt file into databe using PHP, do some calculations based on that table, and then return result in Excel file. This code works well, but I'm not getting all data from the .txt file, since it looks like it stops when it…
Nikola
  • 61
  • 8
-1
votes
1 answer

How do I read a text file and print specified lines which match all conditions?

I'm new to C#. I'm trying to write a winforms application that reads a text file and prints the specific lines according to the conditions. For example, I have a text file look like this: 07/10 08:15:00 EVENT: IN 07/10 08:15:00 BUILDING: A 07/10…
Lee
  • 11
  • 3
-1
votes
1 answer

How to insert a string of plain text from a webpage into my own site's HTML?

Apologies, I'm sure there is a simple solution for this. But after 2 days searching, I can't find the right answer. The basics: I want to pull a string from a plain text file (.txt) that is live and online, uploaded to my server (src="example.txt")…
dirk
  • 1
-1
votes
1 answer

Using a variable as a Filename Python

I cannot get using a variable in the filename to work without throwing an error. def logData(name, info): currentTime = datetime.datetime.now() date = currentTime.strftime("%x") filename = "{}_{}.txt".format(name, date) f =…
-1
votes
3 answers

Deleting blank lines

Python issues: I need some help to figure it out why this code is printing 3 lines with a blank line between them. I want it to print every contact of a .txt starting with a specific letter. For example, if Z is = A, it will…
-1
votes
1 answer

C# app not reading txt files after OCR is done, regardless of content

I made an app in C# in which you drop a PDF file, it its converted to PNG, that PNG is cropped to several parts, and then, OCR is performed on these parts, and write on TXT files is made. So far so good. The issue I'm having is when I try to read…
-1
votes
2 answers

Making directory using read txt file

I'm trying to make a directory using a read file but it not worked. x= open(r'C:\Users\Fast Computer\Desktop\k.txt', 'r') for f in x: path=r'C:\Users\Fast Computer\Desktop' n=f.readline() path=os.path.join(path,n) os.mkdir(path)
-1
votes
1 answer

SSIS Fixed Width Text File - Reference Tables and Appendices

Can someone please share a best practice for the situation I have encountered? I mapped about 20 fixed width text files using SSIS to corresponding staging tables. The data flows as intended into these tables. These fixed width text files are large…