Questions tagged as 'archivo'

1
answer

How to modify a .txt file from c ++?

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...
asked by 20.08.2016 / 23:00
2
answers

Iterate a list and save it in a file

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...
asked by 12.07.2017 / 11:59
1
answer

List the folders of a route (get subdirectories)

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...
asked by 12.02.2018 / 23:44
1
answer

How do I get the weight of a file with python?

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.     
asked by 22.01.2018 / 20:55
2
answers

Using rsync with patterns

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...
asked by 09.12.2015 / 02:55
1
answer

Save first word a file in c

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...
asked by 16.01.2018 / 20:46
2
answers

How to create multiple CSV files from web service execution

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...
asked by 04.03.2016 / 20:27
1
answer

Read / write char arrays in binary files

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...
asked by 05.04.2018 / 10:54
1
answer

Read file .txt and enter data read in variables

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...
asked by 28.04.2017 / 13:06
3
answers

Open files downloaded from PHP

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'...
asked by 04.09.2018 / 16:45