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
3 answers

Convert Dataset to Textfile tab delimited file

I have a DataSet. I would like to convert dataset column as header and row data as data into a tab delimited text file. Is there any technique I can do in my end or I have to do the looping manually? Sincerely Thanks, - Sel
Roseele Dahang
  • 101
  • 1
  • 1
  • 8
1
vote
3 answers

Parse a line from a text file and access the value inside of the parentheses

So i'm parsing a line from text file and getting a string like: color(black) or color(RGB(142,0,0)) So I wrote a code: private Sprite makeSpriteToBackGround(String line) { if (line.contains("color")) { ColorsParser colorsParser…
Dima Ciun
  • 87
  • 1
  • 11
1
vote
1 answer

C++ beginner: why is my compiler returning "name not found" based on my loop?

This is my first time programming with C++ after taking 3 classes in Java (so, definite beginner here). The homework is prompting me to append to a text file and then to search within the text file for a name (in this case, my name). It was working…
katelyn
  • 29
  • 6
1
vote
1 answer

Can't understand how to solve noSuchElementException?

I'm trying to write a program to read a file called scores.txt where it prints out the ID of the student with the highest average across their courses along with their student ID. This is what scores.txt looks like: 34 c081 c082 c083 c084 S2023 …
1
vote
1 answer

Drop NaN and make groupby and export each ID in the first column to a txt file

i have this df: ID COL1 COL2 COL3 0 ZBC174 TYPE 4.0 NaN 1 NaN ID ZBC174 NaN 2 NaN ROW1 50 NaN 3 NaN ROW2 0 NaN 4 NaN ROW3 0 NaN 5 …
Ram
  • 47
  • 3
  • 12
1
vote
2 answers

Write a Python script that prints tickets in columns

I’m struggling to write a Python script to process a file and produce an output text file containing the tickets in a format that is ready for printing via a dot matrix printer. For reference I have also attached an example of what the resultant…
Johno Mils
  • 15
  • 3
1
vote
1 answer

Find two patterns within a specific object in a text file

I'm trying to find two patterns in a text file with PHP. Text file looks like this: [transactionDetails] => wsTransactionDetail Object ( [sharesAmount] => [sharesNumber] => [amount] => 33450 [commerceCode] =>…
Nacho Sarmiento
  • 463
  • 3
  • 8
  • 17
1
vote
1 answer

How to read a text file from HDFS in Scala natively (without using Spark)?

I know I can read a local file in Scala like so: import scala.io.Source val filename = "laba01/ml-100k/u.data" for(line <- Source.fromFile(filename).getLines){ println(line) } This code words fine and prints out the lines from the text file.…
Sergey Zakharov
  • 1,493
  • 3
  • 21
  • 40
1
vote
1 answer

How to add 2 to all integers bigger then 100 in a .txt file in bash

I have a .txt file with bookmarks and all bookmarks above 100 have to be placed 2 pages down from where they are now, because I added two pages in the document. How do I write a bash script that adds 2 to all integers it finds in the document? I'm…
1
vote
2 answers

How to reference data from one text file to another text file

I'm still stuck in here, I'm trying to print a payslip. I want to refer to the employee_info.txt to get the time record according to the employee number. But my problem is the rate is in the employee_info and the days_work is in the time_record.txt…
1
vote
3 answers

Python: How can i search for a whole word in a .txt file?

ive been searching for ages for a solution on my problem: When a user types in a name, which is already saved in a .txt file, it should print "true". If the username is not already existing it should add the name, the user typed in. The Problem is,…
Boritobison
  • 85
  • 1
  • 1
  • 7
1
vote
1 answer

Import Number from Specific Line in Textfile-MATLab

I'm trying to read a number in scientific e notation from like 5 from a textfile of format VEV: 1.500000e+15 Lambda: 9.364217e-107 mu: 1.451533e-38 M: 2.435300e+17 Length Scale Xi: 2.435724e+37 Force Scale Beta: 1.597305e+07 Force Scale Gamma:…
SamuraiMelon
  • 297
  • 3
  • 11
1
vote
5 answers

How to see unique values of a txt file with compared to another txt file?

I have two txt files that every line is an entry. For instance; #first txt file Jonathan25 Donald32 Ethan21 mjisgoat #second txt file Ethan21 leonardo1111 michalengeloo …
Murcielago
  • 45
  • 7
1
vote
1 answer

Reading txt file and adding the contents to a Tkinter Listbox Python

I am wondering how one adds the contents of a .txt file to a Tkinter Listbox? Let's say I had a file called test.txt and I wanted to add the contents of it to a Listbox named Lb, how would I do it? Below is an example of what I have tried - to help…
1
vote
1 answer

Appending a line to an existing text file but adds an extra blank line

I am trying to add a new line to an existing text file, which works but sometimes adds a blank line in between the old data and the new data So I have a file with the data: mouse keyboard And when adding, it adds it like…