Questions tagged [file-manipulation]
219 questions
73
votes
2 answers
how to delete a file with R?
Possible Duplicate:
Automatically Delete Files/Folders in R
I would like to know if there is a way in R to check up if a file is in my current directory, and if it is there then the program deletes it?
I know that other languages have direct…

Layla
- 5,234
- 15
- 51
- 66
14
votes
3 answers
Renaming files during ANT copy
I'd like to copy a directory of files, and rename some of them in the process.
When I run the script below, nothing copies.
If I comment the glob mappers in the file below, the files are copied (without the renaming)
Thanks for any help.
James

tarling
- 1,887
- 2
- 19
- 27
13
votes
2 answers
Replace nth line in a text file
How do I go about in replacing the nth line of a text file in R?

Simanner
- 183
- 1
- 5
9
votes
6 answers
Keeping log files under a certain size
I have an application that is running on a stand-alone panel PC in a kiosk (C#/WPF). It performs some typical logging operations to a text file. The PC has some limited amount of disk space to store these logs as they grow.
What I need to do is be…

BabaBooey
- 1,552
- 3
- 21
- 38
8
votes
3 answers
How to perform file / directory manipulation with user privileges in mind?
I have a server application that will be running under a system account because at any given time, it will be processing requests on behalf of any user on the system. These requests consist of instructions for manipulating the filesystem.
Here's the…

Nathan Osman
- 71,149
- 71
- 256
- 361
7
votes
2 answers
How can I use impersonation to manipulate files/directories on a remote machine with UNC?
I need to download files from a server to a shared drive directory, creating the directory if it doesn't exist. There are a few things making this more complicated:
I do not have write access (nor does the account that will run the job in UAT/Prod)…

Devsman
- 434
- 4
- 17
7
votes
1 answer
How to add extra meta data to PNG?
is there a way to add some extra metadata to a PNG file and then retrieve it with PHP ?
like Comment field.
user529649
6
votes
3 answers
How to insert a line in a file between two blocks of known lines (if not already inserted previously), using bash?
I wrote a bash script which can modify php.ini according to my needs.
Now I have to introduce a new change, and I cannot find a clear solution to it.
I need to modify php.ini in order to insert (if not already inserted…

Luca Borrione
- 16,324
- 8
- 52
- 66
6
votes
2 answers
Python: How to move a file with unicode filename to a unicode folder
I'm having hell with moving a unicode named file between unicode named folders in a Python script under Windows...
What syntax would you use to find all files of type *.ext in a folder and move them to a relative location?
Assume files and folders…

Jonathan Livni
- 101,334
- 104
- 266
- 359
6
votes
1 answer
How can I copy files from folders and subfolders to another folder in R?
I would like to copy files only from 1 root folder that has 100's of folders and subfolders. I do not want to copy the folders. I just want to copy all the files (*.iso, *.txt, *.docx, *.pdf etc.) there are in these folders to another folder.
My…

CuriousBeing
- 1,592
- 14
- 34
5
votes
2 answers
Recursively loop through files in bash and manipulate each file through a command
I want to recursively loop through each file in a folder from bash and do some sort of SIMPLE manipulation to them. For example, change permission, change timestamp, resize image with ImageMagick, etc., you get the idea.
I know (like most beginners)…

GaurangiS
- 85
- 1
- 6
5
votes
2 answers
Copy multiple files from multiple folders to a single folder using R
Hey I want to ask how to copy multiple files from multiple folders to a single folders using R language
Assuming there are three folders:
desktop/folder_A/task/sub_task/
desktop/folder_B/task/sub_task/
desktop/folder_C/task/sub_task/
In each of…

kelvinfrog
- 435
- 1
- 8
- 18
5
votes
5 answers
Saving results of Regex Search into a file with Vim
I've got a HTML file, and I'd like to grab all the links that are in the file and save it into another file using Vim.
I know that the regex would be something like:
:g/href="\v([a-z_/]+)"/
but I don't know where to go from here.

Sasha
- 2,227
- 3
- 23
- 31
4
votes
7 answers
Retrieving tail-end of a file path
I can't find an effective way to do this. The best way to describe what I'm trying to do is by example, so where we go (assuming /bar/ is the parent):
C:\foo\bar\baz\text.txt
will be my path. I'm interested in everything up to the top-level parent…

Dr.McNinja
- 455
- 1
- 6
- 15
4
votes
1 answer
Limit of file size for truncate in R
From ?truncate:
truncate truncates a file opened for writing at its current position. It works only for file connections, and is not implemented on all platforms: on others (including Windows) it will not work for large (> 2Gb) files.
What is…

qed
- 22,298
- 21
- 125
- 196