Questions tagged [text-files]

The TXT file type is primarily associated with 'Text File'. Open in Notepad, WordPad, or many other programs designated as text editors. A true text file will be pure ASCII text with no formatting.

6722 questions
1
vote
1 answer

Extract Specific Text from a Text File Using C#

I want to extract Only IP Addresses from a text file using Regex. Interface: 192.168.8.100 --- 0x11 Internet Address Physical Address Type 192.168.8.1 a8-7d-12-c6-73-2c dynamic 192.168.8.255 ff-ff-ff-ff-ff-ff static …
Uniquedesign
  • 423
  • 1
  • 7
  • 23
1
vote
1 answer

How to set a string from a txt to a variable with cmd

I have a txt file to a specific path that contains one or more line just like the following: Directory of c:\folderA\folderB Directory of c:\folderC\folderD these are the paths of a program example.exe. I want automatically to find the path that…
George
  • 43
  • 1
  • 4
1
vote
1 answer

Looking for Simple Python Formula to Combine Two Text Files

Beginner Python user here. I'm trying to write a formula that will merge two text files. As in, the first file should have the text of the second simply added to it, not replacing anything in either file. Here's what I have so far: def…
ebroker
  • 27
  • 3
1
vote
2 answers

Why is my variable breaking in Powershell? (Grabs variable from file)

FIRST POST IN STACKOVERFLOW! I never asked any questions until now. Please, don't hit me too hard lol. I am trying to create a powershell script to grab a name entered in a config file and feed it into the script. (Renaming a computer) It's worked…
1
vote
2 answers

How do I write multiple lists into their own column in a text file?

I have five lists I need to make into a text file each in their own column. So far I have with open("PR.txt","w") as f: PR = [[Velocity], [Angle], [Impact], [y], [Distance]] for (x) in zip(PR): …
1
vote
1 answer

Pagination for long text file

I have articles that my users upload as plain text files through a form. Everything is working great, but I wish to create a pagination with the buttons "previous" and "next". I tried to search for a jQuery script that could help me, but it seems…
Roberto N
  • 39
  • 6
1
vote
2 answers

Is there a way to select certain elements from a separate text file in Python?

I have started to make an anagram solver with Python, but since I was using a lot of words (every word in the English dictionary), I didn't want them as an array in my Python file and instead had them in a separate text file called…
Will
  • 45
  • 6
1
vote
2 answers

Code to compare two files is to slow - search to improve my code

I am not a specialist in Python and I write a script to compare two file (earthquake data locations). What I wrote is quite ugly and very slow. Does someone have an idea to improve my code ? Thanks ! #!/usr/bin/env python # -*- coding: utf-8…
OcéF
  • 47
  • 8
1
vote
2 answers

How do I extract each words from a text file in scala

I'm pretty much new to Scala. I have a text file that has only one line with file words separated by a semi-colon(;). I want to extract each word, remove the white spaces, convert all to lowercase and call them based on the index of each word. Below…
Ope Baba
  • 65
  • 8
1
vote
1 answer

Retrofit PUT Multipart appends text file after upload in Android

I am trying to upload files to the server using Retrofit 2 with a PUT request. This is how I do it: @Multipart @PUT Call uploadFile(@Url String presignedUrl, @Part MultipartBody.Part file, @Part("file") RequestBody name); Upload text…
Pooja Gaonkar
  • 1,546
  • 17
  • 27
1
vote
2 answers

Python read text file with newline and and paragraph separated elements

I am trying to read a text file to a nested list in Python. That is, I would like to have the output as: [[$5.79, Breyers Ice Cream, Homemade Vanilla, 48 oz], [$6.39, Haagen-dazs, Vanilla Bean Ice Cream, 1 pt], etc...]] The ultimate goal is to…
1
vote
1 answer

Dealing with end-of-line characters cross-platform in C++

I'm busy writing a generic textfile reader class and I'm struggling to write the code to deal correctly with end-of-line (EOL) characters for Mac, Linux and Windows. I've done a some reading on the issue and I came up with the following function…
Kartik
  • 11
  • 2
1
vote
1 answer

Interactive 3D scatter plot from text file created by concatenating multiple files

I have multiple text files with specific filename format in a directory, I want to concatenate all the content from all the files to a single .csv file and need to make an interactive 3D scatter plot using the specific data columns from the final…
VGB
  • 447
  • 6
  • 21
1
vote
3 answers

Compare between date time now and date time add minutes then overwrite the text file

I have create one file which call total-cost.txt and I want to compare two time which is current time and time after added minutes. I have tried and this is my code private void OverwriteText() { DateTime dn = DateTime.Now; DateTime now=…
Kim
  • 33
  • 7
1
vote
1 answer

Find frequency of word and plotting results

I currently have a list of words within a text file, all the words within the document are on a separate line. I also have imported nested json data into a pandas data frame. Json data format looks something similar to this: [ { …
Zoe
  • 49
  • 3
1 2 3
99
100