I want to modify a file .txt from a program developed in c++ , I already have a developed code that creates the file and also reads it, but it does not modify it and I can not find how to do it.
My code is as follows:
#include...
I am trying to iterate a list and then save it to a file .txt with open/write .
lista = ['uno', 'dos', 'tres']
mi_path = "../fichero.txt"
f = open(mi_path, 'a+')
for i in lista:
f.write(i)
f.close()
I give the attribut...
What I'm looking for is to make an array that contains only the names of folders (directories) of a given route.
I tried scandir ():
$scan = scandir(realpath(__dir__));
for ($i = 0; $i < count($scan); $i++) {
if (is_file(dirname(__fi...
I would like to know how you can get the size of a ".txt" file in Python, for example in bytes. I have been looking on the Internet and I can not find any method that is useful for this.
Thank you very much.
How can I make copies of only the files whose names are similar to ones patterns ( patterns ) ? I tried using rsync , but either nothing is copied or everything is copied. These questions in SO in English did not help me:
rsync inclu...
I have a problem with this part of my code, I'm trying to read the lines of a file and cut only the first word of each line and then save it in an array.
The question is that I read the lines well and with strtok cut the first word and send i...
In my program that calls certain web services, I would like that in the final result different CSV files will be created depending on whether the ProjectID is different
In the following code, in the array filter of projectIDs , i...
I am trying to binary save strings from static character arrays and then print them. The point is that, in spite of the fact that I assign them the value in a static way (so when creating them, they should be created with the %code% at th...
I had a question about how to read a text file in which the data come one in each line and enter them in the variables that I want.
Let me explain:
#include <stdio.h>
int main()
{
char fichero[100], nombre[100], apellido[100];
int e...
I'm trying to open files with this function. For files *.pdf and *.txt works fine, but if the file is *.doc or *.odt when downloading and opening it, strange characters appear.
$filepath = '/var/download/prueba.doc'...