Questions tagged [file]

A block of arbitrary information, or resource for storing information, accessible by the string-based name or path. Files are available to computer programs and are usually based on some kind of persistent storage.

Filter by
Sorted by
Tagged with
5
votes
2answers
195 views

Implementation of the `tac` command

As a C programming exercise, I implemented a minimal tac program that prints the input line by line starting from the last line. I'm looking for feedback on my ...
2
votes
1answer
94 views

Convenience function for writing files in CSV, JSON, etc

The McCabe code complexity of the following function is 19 as found by pytest --mccabe test.py (from my toy-project mpu). While ...
7
votes
3answers
179 views

Console based Vocabulary Trainer

This code was reworked and repostet in Console based Vocabulary Trainer Version 2 I wrote a console based Vocabulary Trainer to practice C++. Its possible to add and remove vocabulary and practice ...
5
votes
1answer
328 views

File uploads in Laravel - Single and multiple

I have been reading up on file uploads in Laravel, reading through the documentation and looking at best practices. In my application, I have two instances: an upload area for single files, and an ...
2
votes
1answer
37 views

Creating lstlistings for Java files in multiple Java folders

I did write it to have a solution for my problem. But I don't know if my code is ok. Can you please check it? Problem: I want to include all my Java files from all my projects (created with Netbeans)...
4
votes
1answer
135 views

Word counter for text files

I've made a program that works, but i want to make it reusable. This code reads in a dictionary object created in another class (that i made), as well as read in a text file to put in said dictionary ...
6
votes
1answer
47 views

Reformatting Latin vocabulary sets from The Bridge

I am currently studying Latin from Wheelock's Latin. Given that a core component of language learning is memorizing vocabulary I needed somewhere I could memorize vocabulary, online, namely Quizlet (...
3
votes
2answers
71 views

Find most frequent word in text file

Write a function that a receives file name of a txt file, which contains unknown number of words of max length 10 each. Print ...
4
votes
4answers
144 views

Printing a file

The goal of this function is to print the contents of a file. Pretty much what the simple invocation of cat does. Since C is famously hard, I am looking forward to your comments. ...
5
votes
2answers
95 views

Read a file with transactions and sum all the revenue for each product ISBN

I am trying to improve the algorithms for the following code! The problem I am trying to solve is that I have nested loops that don't look efficient. This includes the Sales_item.h file from C++ ...
4
votes
2answers
64 views

My own functions for working with files

I wrote the functions for opening a file, getting a file size and getting a file contents. I would welcome any suggestions to improve my code. You might think I'm over-commenting the code. But I do ...
13
votes
2answers
12k views

Read and write BMP file in C

I'm teaching myself a little C, and I've found this website. It has an exercise about manipulating a BMP file in C. I would like to know if I can make my code look more "idiomatic" or professional, ...
-3
votes
1answer
156 views

C++ program involving reading and displaying information from a file? [closed]

This is a program I made for practice in file handling in C++. The purpose of the program is to write three nos 1 2 and 3 into a file abc.dat and then read it and display it on the monitor. When I ...
6
votes
2answers
341 views

Program for swimmers to evaluate their training

This is a program that would allow the users to evaluate themselves on a swimming training, it saves the evaluation in a new text file with the date as a title. There are many repeated blocks of code ...
2
votes
1answer
61 views

Function that reads big files in C

I made a function that writes all the data from a hashtable to a .txt file and another to read the said data. The data comes from a this type of struct and it should be read into it when called <...
2
votes
1answer
99 views

Analog of unix word count (wc) in Java

I wrote implementation of unix console program word count "wc" in Java. Please evaluate it. Is there any better solution? ...
4
votes
2answers
765 views

Caesar cipher encryption

I've been studying C++ (my first language) for about two months with books and Udemy courses. I would like some comments about my first real project that I put together for my teacher. ...
10
votes
2answers
4k views

Writing a bitmap image from C++

Here's my function that creates a bitmap file from an array of pixels. It can write a bitmap both with transparency and without transparency. Please review my code and give constructive criticism on ...
7
votes
3answers
3k views

File encryption with password

I would like to have my C# cryptography code reviewed. I programmed an application that encrypts files with a password (provided by the user). It basically functions as a password manager, on the ...
-8
votes
1answer
709 views

Java program to disturb user and waste SSD lifetime [closed]

This Program has three goals: Disturbing the user that accidentally run this by opening a lot of windows Creating a lot of files that waste the lifetime of SSD's Destroying Overview and waste time - ...
5
votes
2answers
835 views

Convert JSON from a webservice to text file

I get list JSON text from a webservice and list_of_columns is predefined, I need the output in that format. I am not sure about few things which are as follows I ...
0
votes
1answer
335 views

Read Local File

I'm trying to read any file locally and write out the binary as string, it loads and reads small files very fast. How can I modifier it to read large files greater than 1gb without crashing the ...
9
votes
1answer
2k views

Markov chains to generate text

This is my Python 3 code to generate text using a Markov chain. The chain first randomly selects a word from a text file. Out of all the occurrences of that word in the text file, the program finds ...
4
votes
2answers
67 views

Using BufferedReader to read lines of a file into a list

To help improve my proficiency with Java, I would like to know how should I close these FileReaders as I have come across multiple answers, and what could I do better with this block of code? ...
5
votes
4answers
564 views

Arrange lines of a text file

This program orders the lines of a text file alphabetically and prints them out to a new text file. Usage: java Arranger input.txt output.txt Is this the best ...
8
votes
1answer
89 views

Implementing a File class

I studying for a Python course. I was finished working on task about creating a file class which can read, write lines to file. This class also needs magic methods (...
4
votes
2answers
257 views

Uploading multiple files to server with PHP and JavaScript

I wrote some code to upload multiple files to a server with PHP and JavaScript. I'm happy with the form and JavaScript, below. ...
1
vote
1answer
92 views

File manipulation with Haskell

I am trying to pick up Haskell! But I feel like my code is a bit painful to write and read. Do you have any pointers on how to improve its readability / style? ...
3
votes
2answers
2k views

AES File Encryption / Decription VB.NET

I've been looking for a while for the right code to encrypt/decrypt files with AES in vb.net. I created the code below. Is this the right way doing AES encryption/decryption nowadays? ...
3
votes
1answer
175 views

Using generator for buffered read of large file in Python

I have a large file that I need to parse - and since it will be regenerated from external queries every time script runs so there is no way to parse it once and cache the results. I want to save ...
3
votes
2answers
860 views

Efficiently read in 2nd column of CSV into List of Lists in Python 3

I created a function to read in arbitrary numbers of .csv files, their 2nd column only, into a list of lists (or if there is a more efficient data structure, then that). I want it to be efficient and ...
2
votes
3answers
969 views

Gradebook program that tracks the performance of the students in the class, displays the students with highest and lowest grades

This program contains two classes, Student and Course, that will allow the user to analyze the performance of students in a ...
5
votes
2answers
66 views

Merging two files' lines of text for output

My program is supposed to merge two text files' lines together. For instance, if I have two files, one.txt: ...
0
votes
0answers
44 views

Optimize the file content comparison

Program to compare if files within two directories are having same content I followed the approach of getting the list of files under two directories recursively and store it in different list with ...
4
votes
2answers
214 views

Reading vertex data from a file

I have a function that reads numbers from a file and constructs a Vector3. Can anyone think of how I can make improvements to this since I am new to C++? The file ...
11
votes
5answers
2k views

Counting relevant entries in a large bioinformatics file

I have a working example of a piece of code which opens up a file, gathers information about the contents, and outputs a map which contains the information. The file The file type is an in-house ...
2
votes
0answers
90 views

TI-Basic file manager

Tested on my TI-84 Plus CE. Variables: F: Stores the file listing's ID N: Stores the current file's ID ...
2
votes
1answer
116 views

Counting different kinds of line terminator characters in files

Can someone take a look if this code piece is ok. I'm most interested whether the goroutines are used correctly, but also general Go best practices. ...
2
votes
2answers
1k views

Word counter using a word list and some text files

My program works with two types of files. File 1 contains 500,000 distinct words. File set 2 contains 173 text files, each containing 500 paragraphs, that I scraped from Wikipedia. The program ...
3
votes
1answer
476 views

Script to store, search, and delete IPFS data with description in JSON file

Here is the script that I would like reviewed for the following: Best practices and design pattern usage Correctness in unanticipated cases Better dictionary access The script is made to store (IPFS)...
6
votes
3answers
114 views

SAT score reader program

This program takes 10 Math SAT scores and 10 Verbal Sat scores from the user, computes the standard deviation and averages, then displays them in a tabular format. After, it displays them to the user ...
3
votes
1answer
593 views

Parse data file and verify checksum

Here's my assignment: Write a program that takes a filename as its only command line argument and prints the results to std::out formatted as follows: ...
1
vote
1answer
5k views

Compare large text File in java line by line

Dear fellow developers I am doing a java program which compare two text files line by line, first text file has 99,000 lines and the other file has 1,15,000 lines. I want to read the files and compare ...
3
votes
1answer
772 views

Multi-query PHP Parser for SQL files

I have an external project, which needs to run an SQL file containing multiple SQL queries (a bit like mysqldump, if you like, but is user-created, with any kind of SQL statement/definition). PHP ...
6
votes
3answers
212 views

File handling in C

I've created an app to manage students' data which also supports file handling. The Student structure looks like this: ...
5
votes
5answers
2k views

Remove control and non-ASCII characters from large files

I get huge incoming files (up to 6GB) and they are littered with Control and non-ASCII characters. I need to strip them and I made this routine (below). The problem is that it is insanely slow. I ...
1
vote
1answer
1k views

Read an image file into a canvas and display click coordinates

I am a beginner in JavaScript, which I have started studying since Summer last year. My code's purpose is read a file from file explorer, and put that image in a canvas. Also there is code to allow ...
2
votes
1answer
7k views

Split a file into multiple files if it reaches a particular limit?

For each clientId, I have a Collection<Task> object. I am making file for each clientId...
5
votes
2answers
1k views

Reading file and writing to output file with line numbers

I started learning java relatively recently as my first computer language independently and would like to see if my approach is efficient. An exercise in the book I am studying from tells me to read a ...
6
votes
2answers
3k views

End of line converter

I recently wrote a python script to convert multiple files EOL's from Unix to DOS and vice versa. I am looking for tips to ...