Questions tagged [writelines]

This tag is designed for questions and answers relating to the `file.writelines()` method in python.

4 questions
0
votes
0 answers

how to add new line in connexion using writeLines function in R

I have a csv file and I created a connection from this csv using file function. Now I would to add a new line to this connextion. But if I use th writeLine function, my new line replace all the pre existing lines because there is no append argument…
lobarth
  • 43
  • 6
0
votes
2 answers

Python: how to print lines from a text file that appear between two tags?

I've got a txt file that essentially reads like this: line line line info info info info info info line line I want to edit the file such that it writes the info lines (including the tags, which are the…
tlcgib
  • 23
  • 4
0
votes
1 answer

Creating a user file input that keeps asking if entered a wrong file name

I had created a python program that asks a user to create a file (for simplicity this will just be a .txt file). The stipulation is that the file can only contain alphabets and an "_". No leading numbers and cannot contain special characters and it…
XeLa
  • 19
  • 1
0
votes
2 answers

Function failing to update spacing after comma

I have a csv file that has inconsistent spacing after the comma, like this: 534323, 93495443,34234234, 3523423423, 2342342,236555, 6564354344 I have written a function that tries to read in the file and makes the spacing consistent, but it doesn't…
BLimitless
  • 2,060
  • 5
  • 17
  • 32