Questions tagged [file-writing]

This tag refers to the process of writing text or data to a file.

932 questions
3
votes
1 answer

Print all columns SAS with delimiter

I am trying to print out a delimited file, without having to specify all of the columns. I can get close, but the numeric columns are always quoted: DATA _NULL_; SET SASHELP.CARS (obs = 5 keep = Make Model EngineSize); FILE "foo.csv" DSD…
mlegge
  • 6,763
  • 3
  • 40
  • 67
3
votes
2 answers

Proper way of waiting until a file is created

I have the following code: // get location where application data director is located var appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); // create dir if it doesnt exist var folder = System.IO.Path.Combine(appData,…
Tono Nam
  • 34,064
  • 78
  • 298
  • 470
3
votes
3 answers

Python: write and read blocks of binary data to a file

I am working on a script where it will breakdown another python script into blocks and using pycrypto to encrypt the blocks (all of this i have successfully done so far), now i am storing the encrypted blocks to a file so that the decrypter can read…
3
votes
2 answers

How to write data into .txt file in codeigniter

I have a folder in assets name is login.My doubt is what how to set the path. $data=$id.'~'.$expense_type.'~'.$amount.'~'.$exp_date.'
'; $todate= date('Y-m-d'); echo $todate; if ( ! write_file('.../assets/login/log_'.$todate.'.txt',…
robins
  • 1,668
  • 6
  • 33
  • 69
3
votes
1 answer

Special characters in filename java

I'm trying to write a file with special characters in filename, for examplo "tééé ê.mp3", but the filename always stay with "?" instead the character "é", I tried a several methods but i didn't found a solution: String musicName = new String("tééé…
pedrodurek
  • 35
  • 1
  • 4
3
votes
1 answer

Writing to disk gets slower over time with Node.js

I am trying to write large files (500 MByte) to disk using Node.js. I figured out that while the first few files are being written in a few seconds (typically, 3 to 5 seconds), starting with around the 10th file things tend to get slower (and it…
Golo Roden
  • 140,679
  • 96
  • 298
  • 425
3
votes
0 answers

Adjust Excel cell width to fit text with xlwt

I'm making a Python application that writes to Excel files. My problem is that, when I write data to a cell that is longer than the with of the cell, excel 'hides' it. I was wondering how is it possible that the cell automatically adjust its width…
stensootla
  • 13,945
  • 9
  • 45
  • 68
2
votes
3 answers

Search and Replace a content in a file in JAVA

I have to edit the contents of a file and write the edited conted to another file.Here is the code iam using . import java.io.*; import java.util.*; public class TestRef { ArrayList lines = new ArrayList(); …
divz
  • 7,847
  • 23
  • 55
  • 78
2
votes
2 answers

Groovy script does not write file as UTF-8

I have the following piece of code: def f = new File("test.txt") f.write("test", "UTF-8") When opening the file in Notepad++ (or any other editor) it is still in ISO-8859-1 instead of UTF-8. Opening the file in a hex editor it does not contain the…
Robert Strauch
  • 12,055
  • 24
  • 120
  • 192
2
votes
1 answer

WSL2 Docker (compose) on /mnt/d is VERY SLOW

Running docker-compose (nginx/php-fpm) is very slow when the project files are on /mnt/d (e.g. D:\). Installing a fresh Laravel installation took about 4 minutes as opposed to 20 seconds. Opening Laravel's homepage (freshly installed homepage) has a…
2
votes
4 answers

How to make a custom print format?

I want to print some variables to a file in a custom table format and have the ability to add to the table without adding the header again and keeping previous information. Here's my code: import time as r data = r.strftime("%d %m %Y %I %M") with…
Zen35X
  • 76
  • 2
  • 10
2
votes
0 answers

Issues with creating an ElementTree object from scratch to write to an xml file

I'm working on a project that is currently having me parse some xml files for data and writing that edited data into a specific xml format. I'm also quite new to working with xml files, so bare with me with my lack of vocabulary. My issue comes in…
Zyga Sovan
  • 21
  • 4
2
votes
1 answer

Modify Array Based on User Input

For my assignment, we are currently coding a hotel booking system. For each room booked I want to make it so that a room that was previously available when selected is eliminated from the array. This is my array: availableRooms[38, 48, 64, 89, 110,…
bradmate
  • 41
  • 1
2
votes
1 answer

Writing to a file parallely while processing in a loop in python

I have a CSV data of 65K. I need to do some processing for each csv line which generates a string at the end. I have to write/append that string in a file. Psuedo Code: for row in csv_data: processed_string = ... …
2
votes
0 answers

Read and write a file offsite? (Replit)

so as the title says, I need to find a way to read and write a file offsite from Replit, so I can use it in Roblox for example (of course not only in Roblox).