Most voted "filing-cabinet" questions
A (Brazilian Portuguese) or (European Portuguese) computer file is a resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available to programs for use after the running program has been completed.
Learn more…693 questions
Sort by count of
-
3
votes2
answers4464
viewsGetting the full path of a client file in ASP.NET
On the server side, you can get full path of a file sent by a client using the tag <input type="file">? For example, if the user sends the file C:\Users\Documents\a.txt, has how the server can…
-
3
votes4
answers8851
viewsFull Python file path
I’m using the method os.listdir() to return a list of all the files, however the return is only the file name and I would like it to return the absolute path, someone knows some way ? The method…
-
3
votes1
answer1276
viewsMark (colorize) a string to write to the file
My application searches for a few words in a file. When the program recognizes these words (strings), it should mark it. For example: change the font color or change the word background color. Then…
-
3
votes1
answer91
viewsC file creation error
I am trying to create a C file but it is not working. The operating system is Linux. #include <stdio.h> void main (FILE *file) { file = fopen("/home/Documentos/teste.odt", "w"); fprintf(file,…
-
3
votes2
answers593
viewsHow to pass filenames to a Datagridview using Folderbrowserdialog?
How do I pass the name of the files that were found inside the selected folder? So far I’ve only managed to get him to pick up the file’s path and move on to the DataGridView and now I want to make…
-
3
votes3
answers1501
viewsRead objects saved in.dat file
How should I proceed so that the reading function can read the arquivo.dat Every time I start the program? I am recording objects in a file, and I need to read them whenever the program starts.…
-
3
votes3
answers527
viewsProtect secret configuration file
I have an isolated file of the others called config.php. It holds information of 3 Databases and some secret passwords, but necessary for the functioning of the system as a whole. I wanted to…
-
3
votes1
answer851
viewsHow to check if a file is corrupted in c#?
How to check if a file is corrupted in c#? Ex: I have a "xpto.txt" file in a directory and need to check that this file is not corrupted.
-
3
votes2
answers355
viewsHow to find, check and change file?
I have a question about being new to the python. I have a file for example: bla bla bla bla bla bla 5 bla bla bla 846:545 energia 3 I intend to read from the file teste.txt the energy information.…
-
3
votes2
answers3318
viewsC - How can I read data from a file (Considering that I use structures for it)
Good night. I’m working on a project for the College in C where I have a data structure to work with the data common to "Offenders," or those who committed an infraction. typedef struct Infractores…
-
3
votes1
answer248
viewsSearch files from a directory
I have a small application that requires a search engine capable of listing the files that contain a term informed by the user. The first functionality of the program, which is responsible for…
-
3
votes1
answer143
viewsHow to not include Finally and still close IO Streams, Connections, Statements, and other Resources?
We know the need to close resources (files, connections, also called Resources) consumed in Java, such as OutputStream and InputStream. When we don’t close them, we create performance problems and…
-
3
votes2
answers2346
viewsGenerate txt file according to the predefined layout in c#
I need to export data from a class according to a specific layout consisting of size and position. For easy maintenance, I need simple layout change. Follow down my class: public class…
-
3
votes1
answer106
viewsUpload large or compressed files?
I have a problem sending files to the server for large files and an idea was to send some of them in compressed form .zip. Is there any problem in leaving open the part of upload so the user can…
-
3
votes1
answer493
viewsHow to convert HTML code to a PDF file in java?
I am developing an application where I need to convert an HTML code, which is saved in the database, into a .PDF. file.No need to save this file to the server. I’ve never done anything like this.…
-
3
votes2
answers589
viewsRead the last 5 lines of a file through Python
I asked that question here at Stackoverlow Display last 5 lines of a PHP file? Now I wonder how I could do the same thing in Python. How could I get the last 5 lines of a large file without having…
-
3
votes2
answers84
viewsReturn the path value
To return the value with the name of a folder in C#? Example, if executed: Directory.GetFiles("%PROGRAMFILES% (x86)\MyApp", "*.*", true); And if he succeeds he returns like this: %PROGRAMFILES%…
-
3
votes1
answer363
viewsHow to Convert Binary Files to String Securely?
Operating System: Windows 10; Version of Ruby: 2.2.1; Server Application: Apache 2 (mod_cgi); I must create a script that reads a file, convert it to text and after a possible processing, send the…
-
3
votes3
answers272
viewsProblems with "strcpy" locking program
I’m solving an exercise where I have to fill a vector like struct, and one of the values is char, for that I made a while and was using a simple assignment with "=" but it wasn’t working, so I did…
-
3
votes1
answer770
viewsHow to change the appearance and behavior of the "Open" and "Cancel" Jfilechooser buttons?
Good people, I’m trying to use Jfilechooser to select directories and also files. What I’m using so far is public void buscaFile() { File[] diretorio = null; diretorio = selectDir(); if(diretorio !=…
-
3
votes0
answers2146
viewsC Client server application for file transfer with TCP socket and thread
I would ask for help from the forum to make secure (encrypt) the transfer of a file between two computers. Below follows the C source code of a client-server application for file transfer using…
-
3
votes0
answers1247
viewsList directory by network
I am using the code below to read files: Locally it works, but when I put the variable $dir with a network path, as below, I get error: $dir = "W:/_Infraestrutura/Controles/Inventario de…
-
3
votes2
answers181
viewsReturn a similar path value
No result in my post, i would like to know how the function would be used Directory.GetFiles, to list the files and folders within it without showing the full path. Ex: public List Listar(String a){…
-
3
votes1
answer199
viewsFunction file() php does not pick line by line
I have a system that is going through a problem, one time it reads line by line from a file, but when I send another file of the same type and with the same content (only a few different things) it…
-
3
votes7
answers1134
viewsSelect a file by name in PHP
Good afternoon, I need help selecting a file by its PHP name. I use the nomenclature pattern starting with the file creation date in the format: 20160111_ALGUMA_COISA and I need my PHP to select…
-
3
votes1
answer960
viewsHow to separate global functions/variables from the program into files?
I have some files: vetores.c // função main uniao.c // função para unir vetores ordena.c // função para ordenar vetores globais.c // arquivo com variáveis globais I want to know how I reference one…
-
3
votes4
answers312
viewsCount distinct names saved in txt
I have a txt file with a line-separated user name below: diego sergio antonio maria diego antonio Notice that names can repeat, and I would like to count and list only the distinct names. I did this…
-
3
votes1
answer907
viewsHow to list the name of the files that are in the directory?
The output of the following method is: C: Users Desktop User files filename.jpg How can I get just the filename.jpg in String format? I tried to use FileUtils but as a way out I got this: ����.…
-
3
votes2
answers2511
viewsHow to add item in array through a foreach?
I’m doing a check in a directory where I list all items with a specific extension. And I need to add the items into one array through a foreach. Follow part of the code I’ve tried. DirectoryInfo di…
-
3
votes2
answers91
viewsUsing a variable as a C file name
I’m using the function system("pathping xxx.xxx.xxx > c:\i.txt") to leave the program doing tests pathping and saving the result in a file to analyze later. Basically wanted to play this role…
-
3
votes1
answer1285
viewsOpen files by passing variable as file name
I have the following situation, a file "tables.txt" where I have around 2000 lines with filename to which I want to pass row by row taking the name of the files and check which ones exist and which…
-
3
votes2
answers331
viewsSave list in file
I have an exercise that I register trucks, cities, loads through a list, but I’m not able to save in a file (it’s the last function) when I select the save option(#7), it closes the program. What am…
-
3
votes1
answer1393
viewsSave.txt file
I’m having difficulties in a code I’ve built. I can’t find the error. My problem is this: I created a code that generates combinations of numbers and that should save these combinations in a file…
-
3
votes1
answer657
viewsCurrent position in the file - C
Hello, I’m having a question about C file manipulation and I’m not getting the answer to that. I am recording an "a" record of type "Student" in a binary file "archiving": fwrite(&a,…
-
3
votes1
answer1093
viewsRemove repeated words using python
I have a text file with many repeated words. I need every word in the file to appear only once. import codecs wordList = codecs.open('Arquivo.txt' , 'r') wordList2 = codecs.open('Arquivo2.txt', 'w')…
-
3
votes2
answers96
viewsForms and Files
I’m making a form where I basically access a file .txt in the CSV format containing certain articles and their prices (e.g., cheese,2.10). The program presents the list in a table, and below appear…
-
3
votes1
answer102
viewsProblem with handling txt files in C++
I am developing a C++ program that should read the keyboard data store them with hash, after performing the reading it must have in its main menu the save option. I can read the save files using the…
-
3
votes1
answer1606
viewsHow to read from a file and save to variables in Java
I’m having difficulties, because in a file manipulation exercise in Java, the teacher asked us to create a program that takes the name and note 1 and note 2 of two proofs and store in a txt file as…
-
3
votes2
answers936
viewsRead file and save lines
I want to read a txt file recording each line of the file in variables of type String, (I use to save some data, of a basic program that I am doing) I thought of something like this try { FileReader…
-
3
votes4
answers1038
viewsHow to create a regex to filter and delete files with a particular chunk in the name
I’m trying to figure out a way to delete files that windows duplicates when making multiple copies. I was able to do something by creating the code below: import java.util.*; import java.io.*;…
-
3
votes2
answers1010
viewsRecursive search in all directories and Ubdirectories of a given folder
I am developing a script to scan a particular folder for certain files and delete them or move them to another folder, according to some rules I already got answered in this question and in this…
-
3
votes4
answers961
viewshow to generate an xml in memory
With the code below, I Gero a file and write somewhere, however, instead of writing to the disk, I wanted to generate in memory, as it does? using (var context = new…
-
3
votes2
answers172
viewsIs it possible to copy directory names without copying their contents?
Some time ago I did this question about recursive search in folders, and now I need to adapt to a different condition. I need to copy only the names of the subfolders from a higher folder to a third…
-
3
votes3
answers72
viewsFilter specific file to not delete
How to make the code not delete a specific file I want between the .exe which I picked up. Example: I want it not to delete "test.exe", but still to continue erasing all the rest. Follows the code:…
-
3
votes2
answers1461
viewsAdd data to a txt file
I have the following code: $msg = "teste"; $myfile = fopen("lista.txt", "w"); fwrite($myfile, $msg."\n"); fclose($myfile); If I change the variable value $msg it opens the file deletes the $msg and…
-
3
votes1
answer928
viewsHow to save an XLSX (Excel) file instead of CSV?
Today I have the code below, which saves a file in CSV format. What I need to change to save in XLSX format (Excel)? public static void buildCSV(string filename = "resultado.xlsx") {…
-
3
votes1
answer77
viewsHow to change a value in a list of R files?
I have a list of files, example 001.R and 002.R. Usually I do: for (i in c('001.R' e '002.R')){source(i)} However, there is now a parameter within each file that I need to change. No 001.R and 002.R…
-
3
votes1
answer36
viewsIf the class ofstream is to write to files, ifstream to read and fstream to both cases, why not always use fstream at once?
Even if we wanted to read, write, modify, create, delete files, or other operations, we could no longer use the class fstream? What problems could they generate if you don’t use those specific?…
-
3
votes2
answers83
viewsGrab last file that entered in "Downloads" folder
How can I open the last file that was downloaded in the folder "Downloads" with Python? I saw several options with the libs os.path and os.walk but none of them makes it possible to take the last…
-
3
votes1
answer2462
viewsPut multiple classes in the same file
In my project I have the class main and created new Java class files with Netbeans to define the objects there. I can only use in main one of the classes, the others I can’t even call the methods.…