6,732
questions
-1
votes
3
answers
77
views
How to compute the total number of words in a text file
I am given a text file (call it text.txt). I need to count the total number of words (counting repetitions as well). My code begins like this:
def words():
f = sc.textFile("text.txt")
...
1
vote
3
answers
132
views
How to read first and last string from file using Java Stream API?
For example, I have a table written to a .txt file like:
Column_A Column_B
Cell_1 Cell_2
Cell_3 Cell_4
Can I obtain the first and last lines in a single stream pipeline?
Additionally, how ...
0
votes
0
answers
26
views
How to build java project (Ant) with external files in Netbeans? [duplicate]
I am creating an application in Apache Netbeans, I want to export it to a .jar file can be run. I have a MS Access database and a text file in my project but when I build the project from Netbeans, it ...
0
votes
0
answers
53
views
Open a file with the default system text editor
I am trying to open a file with the system's default text editor, cross-platform. However, the file type will have a default application other than the text-editor.
For example, say the file is file....
0
votes
1
answer
53
views
Parse a text file into instances of an object
I'm currently working on a university assignment, and I have a problem with parsing text files into instances of an object. A simple explanation of the program I'm working on is a takeaway shop loader....
1
vote
4
answers
89
views
Duplicating entries in textfile for empty entries until a non-empty entry is found, then continue with the new entry
I have a very large textfile in which some entries are missing. The logic is persistent, as the first line of each "section" has the correct entries, every line after this initial line is ...
-1
votes
1
answer
39
views
Pushing text to a file in VBA that contains ", \, and > characters
I am trying to push text to a file that consists of the following string:
<exportfolder value="C:\placeholder_loc" />
In this, the "C:\placeholder_loc" is a different ...
2
votes
1
answer
56
views
Trouble Reading in .txt File
I have a text file I'd like to read in in MATLAB. Here is aforementioned text file (text_a2p.txt):
object index_image.nii
plane transverse
range 100 150
factor 3.1415926535897
coeff .0001 .0004 -.0006
...
0
votes
0
answers
37
views
Reading a Text File (M code) from a SharePoint Document Library
The code below is able to read a text file which contains M syntax and loads it into Power Query. I would like to upload the text file in a SharePoint Document Library for others to use the M syntax. ...
0
votes
0
answers
30
views
Adding Lines to text in Bulk
First of all, since English is not my native language, there may be spelling errors. I’m sorry for that.
Note: I'm using Windows PC
I have approximately 300 txt files. I want to add the line I want to ...
0
votes
1
answer
62
views
How can I create a ANSI encoded text file in UWP?
I'm currently working on a UWP project and would like to create a text file in ANSI charset (Windows-1252, ISO-8859-1).
The reader of this file only supports ANSI. If the reading side now expects the ...
0
votes
1
answer
28
views
How to delete a line in a text file with Python if it contains a certain word? [duplicate]
I have a text file structured as follows:
word 123 etc.
792 test abc
lorem ipsum word
92 testing
random 84
word 184 lmnop
Using Python, how can I delete every line that contains the word word?
0
votes
1
answer
44
views
Why can't I write to a text file in a myRIO project?
For a project, I need to gather data from the myRIO and write it to a text file on my laptop. When I create a myRIO project, connect it to the myRIO and run the program, it doesn't create a text file ...
1
vote
3
answers
57
views
Python look for text block, put in dictonary array
I am trying to look for a text block, and put some of the lines in a dictionary array. So a dictionary for every text block I find. for example the following text:
some
other
text
address-object ...
0
votes
2
answers
68
views
with statement seems to not close file correctly (a subprocess also uses the file)
A step that I am trying to achieve in my program (which is another auto grader, but in python) is to write a temporary txt file containing the output of an outside program (students' homework). I am ...
0
votes
0
answers
106
views
ACCDE error 3625 The text file specification 'X' does not exist
Using MS Access 2019 to deploy an .accde form that I developed.
It checks the value of the current form's version from a .tab text file that is hosted in a shared folder and imported as a linked table ...
0
votes
0
answers
20
views
How can I remove the random texts that shows up in my textfile? [duplicate]
Summary: I used JOptionPane to ask the user a question about their dental problems. I used an ArrayList to read the options they chose and used a class object to return the complimentary treatment as ...
0
votes
0
answers
57
views
Error when trying to mutate a dataframe containing lists
I have a dataframe containing lists, which looks similar to the following with the exception that the original has a lot more elements and rows:
p stim ...
1
vote
2
answers
66
views
How to replace multiple matches of reoccurring word in a .txt file with new words?
So I have a .txt file with several dataframes. It looks similar to the following example:
$stim
rt 82289.8878539, 82294.8309221, 82299.3357436, 82304.1822179
category 1, 2, 1, 1
orient 263, 313, 266, ...
-1
votes
1
answer
108
views
Is it possible to put the captions generated by AI models back into the pdf file?
I have a pdf that contains multiple pages where each page consists of texts and/or images. I have found ways to extract images from a pdf file and I have found ways to use AI models to generate ...
0
votes
0
answers
19
views
remove double quotes wrapping from csv file in python and save to same file
i have csv file with data wrapped between double quotes, like the below. i want to transform the same file to remove these double quotes.
"a","b","c","d","...
0
votes
0
answers
23
views
Marquee on web page reads text from textfile but displayed text is truncated
I have a marquee on a webpage which is receiving text from a text file. My issue is that the displayed text is truncated and I can't seem to modify any properties. Any idea how to allow for a longer ...
-1
votes
1
answer
54
views
Unable to extract necessary information from my .txt file
0 .17 .29 d ih
1 .29 .73 k l ay n d
1 .73 .84 g ih
This is a sample of the .txt file that I am working on.
I have tried using the np.loadtxt() to extract the last column,
...
0
votes
1
answer
49
views
Importing data with no common delineator between the values, the number of spaces between values and within values overlap
I am trying to import data from a large text file that does have a common delineator between the values. There is anywhere from 1 up to about 5 or so spaces between each of the values, but there are ...
1
vote
1
answer
166
views
Reading arrays from txt file in python to plot a graph
I'm new to python and want to plot a graph using data stored in arrays on a txt file...
content in the txt file ar just the arrays... nothing else.. exemple:
arrays.txt
[0, 1, 10, 5, 40, 1, 70] [12, ...
1
vote
1
answer
201
views
Write text to a text file in RTL format
I have an array of text, I want to write it to a .txt file from right to left since it is in Arabic or Kurdish. How can I do that using python?
Method to write to a file:
with open(...
0
votes
2
answers
258
views
How to delete text in text file using Python based on conditions?
I have a text file from which I want to delete all data up to the point where I see the value 'NODATACODE' .
The text in the text file is:
MMMMM ; MMMMM : MMMMMMMMMMN, AAAAAAAAAAA,52, AAAA,CCCCCC, ...
0
votes
0
answers
29
views
Parsing a line in a text file into a table based on selection in list box
I'm building a simple app in Visual Basic for school. It's a TNR cat record locator.
Goal: Enter cat's name and details, submit data, data writes to text file and saves cat name as entry in a list box....
-1
votes
1
answer
42
views
How to make a dictionary from a text file with many elements? [duplicate]
I'm trying to make a dictionary for the text file Subscrition_Info.txt. the text file looks like this:
I need to make it into a dictionary named subscriptions, but I don't know how to because the ...
1
vote
2
answers
134
views
Program does not enter the while loop
#include <stdio.h>
#include <string.h>
struct Employee {
int id;
char name[50];
float salary;
};
int main() {
FILE *file;
char filename[] = "employee.txt";
...
0
votes
0
answers
50
views
(in js) reading the contents of a local text file into a string [duplicate]
(after 20 hours of failing with the many clever code snippets already posted on Stack Overflow, as a js beginner .. )
my project needs a conceptually simple js function, something like:
var sOut = '';
...
0
votes
1
answer
297
views
Unable to serve a text file with no extension from Azure Web App
I'm trying to serve a text file that has no extension from within a Web App.
The file is located in the .well-known folder. Other files (with json extension) from the .well-known folder are accessible,...
0
votes
1
answer
54
views
How to read property names and its value which are in single quotes in File1.txt and find that property name and value in File2.txt
How to read property names, (ex: SysValidate#URL) and its value from single quotes, '/api/sys/test', in File1.txt and find that property name and value in File2.txt.
File1.txt
Wed 11/08/2023 - 13:47:...
0
votes
1
answer
81
views
How to read and extract values from single quotes ('') in a text file and find that value in another file, if not exits thrown an error
new to batch file scripting. Need your all help to extract all the values which are in (single quotes) '' from below text file (file.txt) and find that value in another text file, if not exists throw ...
3
votes
3
answers
143
views
how do i read the next line after finding a variable in a text file using python?
I am trying to make an app for electric vehicle drivers and i'm using a text file to store the data the way it works is i have the name of the electric vehicle and the the line under the name contains ...
0
votes
0
answers
159
views
How to move the cursor to the beginning of the next line on a .txt file?
I am writing a function with which, I'm trying to load saved data from a file to an array of records. The file is going to contain a name of the type of data I want to read. After that initial line ...
0
votes
1
answer
247
views
Delphi Text file not found
I saved my text file in the same folder as my Delphi project but when I test if the file exists, it still says it does not exist. I've tried everything I know of what I could find on the web but ...
0
votes
0
answers
65
views
When I Programmatically download a text file, its content changes
I have a text file in the site that when I download it through Windows, and open the file on the system, its content is displayed correctly (it is what it was, pic1).
But when I download with the ...
-1
votes
2
answers
150
views
Python Read/Write Text Files [closed]
I have a .rtf file containing a unique string on each line, 1000 lines or so. I want to remove the last character off of each of those lines, and output the result into a new .csv file so that I can ...
0
votes
0
answers
85
views
How do I get a a specific value from a text file and a XML file? AutomationAnywhere A360
I have two problems in AutomationAnywhere A360.
Get a specific value from a PDF (I could convert the pdf into a text file)
I have an invoice in PDF format.
In addition, I have an Excel list with ...
1
vote
1
answer
247
views
Parsing a unicode text file in VBA Excel
I am trying to parse through a file and grab little bits of relevant data. My method worked but I had a suspicion it was weak. Testing on multiple files confirmed it. The files are PDF's mostly ...
0
votes
1
answer
64
views
Reading a .txt file in Java project
I am working on a Java program that reads an input 1.txt text file line-by-line, each with a number for example:
2
1 2
2 1
2 1
1 2
The program suppose to take each number and throws to implement Gale-...
0
votes
1
answer
242
views
When moving and refactoring a file, Pycharm displays Error Cannot Move message
I tried to move a textfile to a new directory using F6 and drag and drop.
The IDE displays the following error:
Error Cannot Move
I expected to move the file successfully into the new directory. How ...
1
vote
0
answers
112
views
Java code in Android Studio to delete a file or erase data in it
I tried different codes but none seem to work. The deletion is going into the same directory. It can detect the file. It also gives false positive as deleted but when the file is prompted to be opened ...
-2
votes
1
answer
232
views
Create a dictionary from a list of lines in a text file
I am trying to create a dictionary from a list of lines in a text file, but my for loop iterates over one line only. What could be the problem. Here is my code
with open("data.txt", "r&...
0
votes
0
answers
93
views
Input won't save to a text file after the first run, won't append or overwrite after the first run
I am using netbeans windows 11, I just want to save input entered to a text file without it getting overwritten ideally. It works fine on the first run, text file gets created, input gets written to ...
-1
votes
1
answer
134
views
Open List or Array of HTTP Link Urls Slowly And Close Tabs or Windows 5 Seconds Later
I can open the links with bash, but I can't find a way to open them one by over every 2 seconds and close them at the same interval. I want to be able to watch a screen and look are hundreds of urls ...
0
votes
0
answers
59
views
removing columns from a text file
I am trying to convert biometric data into something useful such as getting their total late in coming data, I've got a python code from years ago and I have just started learning C# today but I'm at ...
0
votes
0
answers
97
views
Dynamically write chinese characters into text file using kotlin
screenshot of current text file output
screenshot of Expected text file output
Right now ive issue when writing transactionDescription into text file. So the issue is
although both "Buyers cash1&...
-4
votes
1
answer
55
views
Calculate mean for variables in txt files [closed]
I need to calculate the mean for TRODRY and TROWET for this text file in python , since I have many files of this text file my file format is as follows:
%=TRO 0.01 EMR 23:208:83100 EMR 21:005:00030 ...