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
2 votes
1 answer
94 views

ProcessPoolExecutor KMZ file search

I've written a script to look for coordinates in KMZ files. I've tried to speed execution up using the ProcessPoolExecutor. I'm quite new to Python, so any recommendations are more than welcome. <...
Blasco's user avatar
  • 783
2 votes
1 answer
106 views

Read a directory of CSV files in R

I'm writing a lot of R in my spare time and am trying to get into good habits by using TidyVerse as much as possible. A large part of this has required reading entire directories of dated log files ...
MD-Tech's user avatar
  • 123
4 votes
3 answers
2k views

Library Management using File Handling

I have never written program in file handling. Help me improve this program. book.h ...
coder's user avatar
  • 2,449
3 votes
1 answer
446 views

Deadbeef : finding all words made of hexadecimal digits

Hexadecimal 0xdead, 0xbeef are the magic numbers because they're also English words. I decided to find such words as many as possible. How to do it? We need large ...
triclosan's user avatar
  • 254
3 votes
1 answer
497 views

Get the common values between two text files

I'm just trying to get the common values from two distinct files called file1.txt and file2.txt where I'm using Python's ...
Karn Kumar's user avatar
7 votes
1 answer
4k views

A little Python hex editor

First off I'm quite new to Python, there will be a lot of messy/overcomplicated code, that's why I'm posting on this site. This code is written in Python (2.7) using the Tkinter library. Questions To ...
Jachdich's user avatar
  • 181
8 votes
1 answer
171 views

Python tool to assemble CodeReview posts from source files

I hate having to format questions around here. Adding four spaces to each source file and the correct name at the top of each source file becomes a headache when I have to post longer questions. This ...
Gnik's user avatar
  • 882
10 votes
3 answers
4k views

Implementation of Linux cp in modern C++

This is my simple implementation of the Unix cp command. It is a C++ program but makes use of some of the lower level C library I/O functions. Any suggestions for ...
halius's user avatar
  • 103
1 vote
1 answer
2k views

Reading lines from a file and processing them concurrently

I'd like to read lines from a file and process them concurrently. I came up with the following code to do this: ...
Abe Miessler's user avatar
4 votes
0 answers
231 views

Script to auto-generate Markdown tables of contents

I would greatly appreciate feedback on the enclosed script, which auto-generates a Markdown table of contents for Github-flavoured Markdown, with respect to: Consistency with Ruby idiom & style ...
Alex Harvey's user avatar
7 votes
2 answers
217 views

Cleaning a file / Word Query

In a followup this application was turned into a GUI using FLTK: Cleaning a file / Word Query GUI (FLTK) I did the following two exercises in Programming: Principles and Practice Using C++ (2nd ...
Sandro4912's user avatar
  • 3,046
1 vote
2 answers
3k views

VBA - faster way to list out files in a folder & subfolders

I have written a VBA code in excel (basically through combining various codes from others -_-") to list out the path, file name, file size & extension of all files under a folder and the sub-...
i.c's user avatar
  • 13
5 votes
0 answers
142 views

Comparing same-size files and reporting on the differences byte-by-byte

I created a small Python utility to analyze multiple same-size files and report on the difference byte-by-byte (i.e. Hamming distance, not Levenshtein distance.) I am planning to extend the ...
Graham's user avatar
  • 1,369
4 votes
2 answers
71 views

Escaped line reader

The idiomatic way of reading lines from a file doesn't work for my purposes because the files I'm dealing with might have lines that are escaped. I came up with the below (which seems to meet my needs)...
Kittoes0124's user avatar
  • 1,940
4 votes
1 answer
111 views

Minimalist config file reader/writer

I have written a simple configuration file reader and writer in D that is intended to parse string[string] associative arrays (the whole file is one array) and ...
Jacob Birkett's user avatar
4 votes
2 answers
103 views

Importing files into Excel

Any tips to reduce lines, improve speed, or any cool thing, are welcome. I have been using this for years and I just realized, why not improve ...? ...
William Cezar's user avatar
2 votes
2 answers
86 views

Random binary digit generation and file I/O

I've recently made a program which generates a (pseudo) random binary digit (1,0) which is tied to a specific subject to learn for every day of the week. The program generates the digits the first ...
Cvetelyn Ivanov's user avatar
7 votes
3 answers
975 views

Convert binary raster file to text CSV

I have a binary file input.hgt from the Shuttle Radar Topography Mission. It contains a 3601✕3601 matrix, stored as 2-Byte big-endian integer numbers. My code ...
Khaled's user avatar
  • 309
4 votes
1 answer
362 views

Reversing a file in Fortran

This is my first foray into (modern) Fortran in order to learn a bit more about the language, and I'm attempting the following problem: taking the path of an arbitrarily-sized text or binary file ...
Harry King's user avatar
5 votes
2 answers
84 views

Producing excerpts from a file at specified positions within long lines (>1 M characters)

I'm trying to read a file containing over 10.000 lines and each line contains an ID for an individual and a very long string composed of more than 1 million characters (numbers as example: ...
Adroacir's user avatar
4 votes
1 answer
2k views

B-Tree implementation in secondary-memory/disk-memory

I will start by saying this implementation was based on the approach taken with B-Trees in the book: Introduction to Algorithms, 3rd Edition - Cormen, 2011 The implementation stores all the b-tree ...
MiguelD's user avatar
  • 297
1 vote
2 answers
56 views

Method that reads an input file of a particular format and creates objects corresponding to the file

This is essentially a best practices question about reading a file and making sure it follows a specific format. My current implementation works, but it's a while ...
James Lubin's user avatar
5 votes
2 answers
2k 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 ...
Theo's user avatar
  • 151
2 votes
1 answer
124 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 ...
Martin Thoma's user avatar
  • 1,195
7 votes
3 answers
419 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 ...
Sandro4912's user avatar
  • 3,046
5 votes
1 answer
2k 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 ...
Jesse Orange's user avatar
2 votes
1 answer
50 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)...
Aurel Ernst's user avatar
4 votes
1 answer
669 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 ...
FeelingLikeAJabroni's user avatar
6 votes
1 answer
65 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 (...
Ethan Bierlein's user avatar
3 votes
2 answers
191 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 ...
Itay4's user avatar
  • 155
5 votes
4 answers
178 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. ...
Gregor P. Student's user avatar
5 votes
2 answers
149 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++ ...
Randy Diaz's user avatar
4 votes
2 answers
74 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 ...
eanmos's user avatar
  • 395
16 votes
2 answers
41k 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, ...
Camilo's user avatar
  • 163
-3 votes
1 answer
166 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 ...
Hema's user avatar
  • 99
6 votes
2 answers
363 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 ...
Omar.B's user avatar
  • 295
2 votes
1 answer
73 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 <...
MiguelD's user avatar
  • 297
2 votes
1 answer
522 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? ...
KXCompare's user avatar
4 votes
2 answers
1k 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. ...
Ricardo Doberstein's user avatar
10 votes
2 answers
8k 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 ...
user170483's user avatar
8 votes
3 answers
6k 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 ...
Mick's user avatar
  • 91
-6 votes
1 answer
892 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 - ...
Dexter Thorn's user avatar
  • 2,154
5 votes
2 answers
1k 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 ...
Sam Si's user avatar
  • 53
0 votes
1 answer
383 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 ...
king amada's user avatar
9 votes
1 answer
3k 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 ...
AnanthaKrishna K's user avatar
4 votes
2 answers
131 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? ...
Kyle's user avatar
  • 39
5 votes
4 answers
2k 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 ...
Dexter Thorn's user avatar
  • 2,154
8 votes
1 answer
110 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 (...
Larionov Nikita's user avatar
5 votes
2 answers
868 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. ...
Tania Rascia's user avatar
1 vote
1 answer
264 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? ...
Jsevillamol's user avatar

1
3 4
5
6 7
17