Category "file-handling"

How to store contents of string array into 2D array in python and perform operations without any built in function?

I have tried almost everything I cannot figure it out. I cannot figure out which array to use. This is the question and the required output:

Unsupported operand type(s) for +: 'WindowsPath' and 'str'

The code I'm working on throws the error Unsupported operand type(s) for +: 'WindowsPath' and 'str'. I have tried many things, and none have fixed this (aside f

Loop for load multiples files (C++)

I´m trying to load all the files in a folder that have names from the form "file_i.csv". For this I write the program: void load_reel_set() { bool fil

How to read/write a file in Java

I would like to replace some items in a file, based on some regular expressions. In order to do that: I read the file line per line For every line, I check for

Move file pointer to the end

I am trying to make a students details record program in c wherein I will store all the data in a file. I will provide the user with options such as entering a

How write python to Read the first two lines from a text file named "file1.txt" Write the two lines read from "file1.txt" to a new file "file2.txt"

Read the first two lines from a text file named "file1.txt" Write the two lines read from "file1.txt" to a new file "file2.txt"

Creating a file using fopen()

I am just creating a basic file handling program. the code is this: #include <stdio.h> int main() { FILE *p; p=fopen("D:\\TENLINES.TXT","r"); if(p==0) {

How to check if a file is empty in Bash?

I have a file called diff.txt. I Want to check whether it is empty. I wrote a bash script something like below, but I couldn't get it work. if [ -s diff.txt ] t