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.
1
vote
1answer
17 views
Searching and replacing text
Simple Playlist Modifier
This program is a search and replace program for text based files. The main goal of the program is to replace directory paths to music files.
The idea is to have the program ...
-2
votes
1answer
47 views
Merging files in Bash
I had this homework assignment:
Create on the desktop a folder with your name.
Copy from your account [email protected] two files, ...
6
votes
2answers
142 views
Some sort of console “notepad”
This is notepad that works with list of files (pages w/e) that can be edited (list). You can access each file separately and edit/view it too (rewrite, append, read). Here's my implementation of it. I ...
1
vote
1answer
24 views
Writing computer generated music to a wav.file in C - follow-up 2
See the previous iteration.
What's new: endianness is now handled more gracefully (only one endianness check, and convertion if need be) and music is more funky.
...
10
votes
4answers
234 views
Writing computer generated music to a .wav file in C - follow-up
See the previous and initial iteration.
See the next iteration.
Now I have refactored the code according to many suggestions made in the first iteration.
What's new:
I attempted to deal with ...
29
votes
5answers
2k views
Writing computer generated music to a .wav file in C
See the next iteration.
I wrote this simple C program for writing computer generated music to a WAV file over three years ago. I refactored it a little, but it does not look good to me. Any ...
5
votes
3answers
291 views
32-bit checksum of a file
I have implemented a function to produce a 32-bit checksum of a file using the following method: checksum = word_1 + word_2 + ... + word_n, where ...
2
votes
1answer
17 views
Saving and loading parts of configuration
I have a piece of code where I have string pairs (eg. 'a' and 'AA'), where both have their own unique ids. Id for first object is configured by user and second id is received at some point during ...
4
votes
3answers
71 views
Writing huge 2D vectors to text file too slow
I have 10 large (34 million cell) 2D gridded vectors storing doubles. When written they are over 200 MB in size. I use an ofstream object to write them to a text ...
2
votes
2answers
276 views
Load text file into an array in Swift
I'm drowning in Swift optionals and error handling syntax. I'm just converting a text file into an array of Strings. One would think that this could be a simple two or three liner but by the time I ...
1
vote
0answers
51 views
Chunked file upload
I'm working on an PHP application that will allow (but not require) chunked file upload (from jQuery File Upload on the front side). I tried to find appropriate code and was only able to find the ...
8
votes
6answers
2k views
Sorting a list of first names from a text file
I applied for a job as a C#/.NET Junior Developer, and had a test to do::
Using names.txt (right click and 'Save Link/Target As...'), a 46K text
file containing over five-thousand first names, ...
0
votes
1answer
67 views
Appending to file slowdowns the process
The process:
I read the lookup and create a list aa.
I traverse through the glob.glob("C:\\project resource\\dump\\*.html") ...
2
votes
1answer
41 views
Reading numbers from a file with lazy ByteString
This is my code for lazily reading a very large file which contains numbers separated by a new line character. Is there a way to simplify this using the ByteString ...
2
votes
1answer
51 views
Sort files by the type of file
I need to sort files by the type of the File. To accomplish the task I first wrote the code below:
...
2
votes
4answers
253 views
Removing the extension from a filename
Let me know if the given code can be improved or optimized:
...
3
votes
2answers
173 views
Returning the length of the File in B/KB/MB
The method length() in File returns the length of a file in Bytes, this code transforms that into b/kb/mb as can be seen in the ...
0
votes
1answer
36 views
Simplicity decider
I was interested in the Code Golf challange about simple text. The spec is:
Write a function that from a text returns the non-common words.
I assumed non clean input so I cleaned it before ...
5
votes
0answers
55 views
Processing files with streams
I'm using iojs. I have to read some files as a stream, process them with a same function and join them back into a stream. So, I decided to create my own solution with ...
3
votes
1answer
76 views
Class in a DLL to extract data from a file via many accessors
I'm making a class that takes a path to a text file as an argument in its constructor, and then parses the text file and pulls out a lot of data that it stores as private members. Most of these ...
20
votes
4answers
255 views
Convert Bitmap Font to Texture Atlas
I wanted to render the textures that comprise a bitmap font glyph onto the screen directly as an Image in libGDX. When you make a bitmap font using a program (such ...
4
votes
2answers
56 views
Longest lines of file descending
This is a challenge question from codeeval.com:
Write a program which reads a file and prints to stdout the specified
number of the longest lines that are sorted based on their length in
...
19
votes
2answers
1k views
Please Save My Name
I wanted to create a save game system for my city building game that did not require the player to input a name for the city. It was also important to allow infinite save games, so I could not just ...
7
votes
1answer
62 views
Python XML parsing, extraction and renaming files
I've written some code to:
Parse an XML file.
Extract some strings.
Make copies of the original XML whose names are suffixed with the extracted strings.
Please review this.
...
8
votes
2answers
186 views
Reusable, generic save method
I am developing a Python script that will process large amounts of data from an experiment. Files are read in, calculations are made, images are plotted and saved as .pngs, and calculated parameters ...
1
vote
1answer
44 views
Aggregation of files
I have millions of files in a folder. File types will be with the name PES_timestamp and DOM_timestamp. I have to aggregate all PES and DOM filenames into one file which has the same filename.
The ...
1
vote
0answers
31 views
Favicon Downloading Script
I use this file to download favicons and was wondering why it seems to be so complicated. I've noticed that people seem to save their favicons in many different types of ways.
On top of that, PHP ...
2
votes
2answers
86 views
Program that reads 4 files and outputs contents of it into another file after formatting it
The below Python 3 program scans 4 files a.txt, b.txt, c.txt, ...
7
votes
4answers
182 views
iTunes playlist copier
When you own an Android device and want your iTunes playlist to be copied over onto it, what do you do?
What if your playlist hits something in the region of 20GB+ ? Well, I am sure I could've paid ...
5
votes
3answers
247 views
Writing a large file of numbers
Basically, I want to write a huge file of numbers. Each line in that file should contain one number. This program below is extremely slow (obviously) but it works. It writes one line after line and ...
3
votes
1answer
33 views
Inserting filename, reading data, inserting regex, and testing if each line matches - version 2
This is a improved version of the program seen in my older question.
This program first displays a menu which shows some options that the user can select. Each option will the respective functions ...
5
votes
1answer
64 views
Inserting filename, reading data, inserting regex, and testing if each line matches
This program first displays a menu which shows some options that the user can select. Each option will the respective functions which do some things.
The user can insert a filename, read data from ...
6
votes
2answers
460 views
The most efficient way to merge two lists in Java
I am looking for a way to merge two files with a list of distinct words, one word per line. I have to create a new txt file that would contain all the words of the first list and all the words from ...
2
votes
1answer
68 views
Looking for identical files (or directories) in a filesystem
Dilemma
The code below is in its infancy, but for now is an effort to crawl my entire file system and find duplicates whilst adhering to a variety of exclusion criteria. My current strategy for ...
8
votes
2answers
205 views
Text Analyzer - Properly implementing Java coding style
As a new Java learner I would like to improve my coding style.
I wrote a program which gets as an input a file name, and asks for two file names for the output.
The first output file includes all the ...
4
votes
1answer
75 views
Reading a text file API 15+
Is there a faster, more efficient way to read a text file than this implementation?
Taking into account phones capabilities:
...
2
votes
1answer
75 views
Reading the bytes of a PDF
I'm quite a newbie in Python and I want to speed up this method since it takes very long time especially when the size of the input file in Mbs. Also, I couldn't figure out how to use Cython in the ...
5
votes
2answers
183 views
Showing the contents of a file
This program reads a filename from standard input and then prints its content. Please review:
...
3
votes
1answer
70 views
Input data from file, calculating average by a function
I want to thank you guys firstly for your previous comments and feedback. Really appreciate it. I am learning C with school at the moment, but I plan to be "fluent" in C at the end of august of this ...
15
votes
2answers
1k views
Can I buff up your file?
Here I have a method for reading the contents of a file into a buffer and returning whether or not it is successful.
Here is what I would like reviewed:
Speed: Am I reading in the file as fast as ...
2
votes
1answer
415 views
Extracting ZIP, JAR and EPUB files
I wrote a utility class that is used to extract the contents of a ZIP file to a destination folder. This is a very small class, but it has several practical applications: it can not only be used to ...
1
vote
1answer
133 views
Search string by regex in files and write line of found string
I am searching in files with extensions .xml, .java, and .properties strings that match a certain regular expression.
When I find it, I write it to the file with the filename, line and string ...
2
votes
3answers
95 views
Simple and safe file reader for C
As an exercise to improve my coding ability in C, I have attempted to write a simple and safe file reader. I believe this should be portable as well to major platforms (correct me if I'm wrong). For ...
2
votes
0answers
70 views
Organising loops for parsing a text file
The following code is from a utility I've written for myself.
It takes a file in this format:
...
12
votes
1answer
157 views
Wanted a cat. Got lolcat
Wanna learn Rust? Ya rly!
I can haz FizzBuzz? No wai!
Gimme /bin/cat then. But rustc say LOL! Must handle teh err0rz!
Now iz ...
7
votes
2answers
167 views
Manage multiple file writes in C
I have a very simple C program that continuously reads from a temperature sensor and displays the temperature on two 7-segment LEDs. Reading is simple, but to display the LEDs I need to write to 14 ...
1
vote
2answers
48 views
Reading files with code value pairs
I have a text file with about a hundred code value pairs [$code, Value].
For example:
Sample file
...
6
votes
1answer
649 views
Merging multiple JSON files using Python
I have multiple (1000+) JSON files each of which contain a JSON array. I want to merge all these files into a single file.
I came up with the following, which reads each of those files and creates a ...
1
vote
1answer
110 views
Creating an adjacency list in C++
I want to create an adjacency list based on data I get from a text file. Could I make this simpler?
...
1
vote
2answers
1k views
Parsing a big text file, extract data & store it in a CSV file
I have a big log file (say 1-3 Gb) which I need to parse, extract data & save it in a CSV file.
Text File Data
...