Questions tagged [file-manipulation]
219 questions
0
votes
1 answer
Manipulating a file that is like XML
I have a file that I want to read and manipulate. It is XML like but is not an actual XML file. It does reference a DTD however. What part of the .Net framework can I use to do the above? Will the XML API's work some how with this file?

Vidar
- 6,548
- 22
- 66
- 96
0
votes
0 answers
copy a subset of files from a current folder to two different destination folders after numerical sorting
I need to copy a sub-set of files from one folder to another, and repeat this process between multiple folders via R. My files are NetCDF files, where the file name convention is: letter "A" followed by YYYYDDD_(S)day.or.(N)night (DDD as julian…

TDS
- 27
- 4
0
votes
2 answers
Pascal - not writing to file
Howdy, Pascal masters!
I've got a file type of custom records:
DBCell = record
Name: string[10];
Surname: string[15];
Balance:integer;
OpenDate: record
year: integer;
month: 1..12;
day:1..31
end;
…

Arnthor
- 2,563
- 6
- 34
- 54
0
votes
1 answer
How do I read words from a file, assign them to an array and analyze its content?
I (a student whose professor encourages online research to complete projects) have an assignment where I have to analyze the contents of a file (frequency of certain words, total word cout, largest and smallest word) and I'm getting stuck on even…

jamie bellinger
- 1
- 1
0
votes
1 answer
How to delete last bit of a file in R?
After some experimentation, I found the best way (for my code) to convert an r data frame into XML is with the following script:
ConvertDataFrameToXML <- function(dataFrame,fileName) {
cat("", file = fileName, append = TRUE)
…

Sinnombre
- 346
- 1
- 7
0
votes
0 answers
C program for creating folders based on file extensions and copying files with the extensions into them
I am trying to create a c program that reads the extensions of the files in its current working directory.
The program then creates folders that correspond to the extensions of the files. It then copies each file
from its cwd into the corresponding…

Kinyugo
- 429
- 1
- 4
- 11
0
votes
5 answers
How to make a program that replaces newlines in python file with a string
I am trying to display my python file in html and therefore I would like to replace every time the file jumps to a newline with < br> but the program I've written is not working.
I've looked on here and tried changing the code around a bit I have…

Yann Kull
- 51
- 5
0
votes
1 answer
Java program to compare two text files, then replace variables found in the first text file with those in the 2nd file into a 3rd file
So I would like to ask if there is any way to modify the code I currently have in order to make it so it only replaces certain parts of the text file.
Let's say I have a text file called TestFile1 that contains
A = Apple
B = Banana
C = Carrot
…

sNk
- 1
- 2
0
votes
1 answer
nested line to array transformation and access specific value
I've an input VCF file that looks like this:
# ...
6 29911899 . A ACC . . …

cccnrc
- 1,195
- 11
- 27
0
votes
2 answers
How to delete lines in a file up to a certain character in python 3
I have a very big file that I need to parse. I don't need any of the lines up to '&'. I just need the information after the '&' in the file. How do I delete the lines before the '&'? This is what I have so far:
import re
original_file =…

CarlosX2X
- 193
- 1
- 1
- 9
0
votes
1 answer
How to fix the fprintf loop?
I've got a .txt file written like this:
PersonName colour1 colour2 colour3
for example:
Nick blue green black
Lisa orange yellow green
Mark white blue orange
my program: editColour(fileName, colourInTheFile, colourIWant)
should change the…

Osmion
- 19
- 5
0
votes
0 answers
Copying sub folders from a folder to another folder using R
I have a folder called 6a in my working directory which has four subfolders. I want to create another new folder called 6b in my working directory and copy the subfolders of 6a into 6b. I did this
dir.create(paste0(getwd(),"/6b"), showWarnings =…

89_Simple
- 3,393
- 3
- 39
- 94
0
votes
1 answer
Appending file_name part to each line of the file, recursively to multiple files
So, I have multiple files of the form
filename_date.csv
in a folder, for example something like
filename_2010_01_01.csv
that files contains, say... 1000 rows with a format like this
37845287|2364532467|237849853
04568750|89345735385|94573857
But…

Gus
- 573
- 1
- 5
- 18
0
votes
1 answer
Edit json file using ansible
I am trying to edit a particular JSON file using Ansible. The file is present in remote servers which have to be logged in using LDAP authentication.
The file path is /etc/sensu/conf.d/client.json
and the line that I want to edit is as…

Antarjyoti Sen
- 11
- 1
0
votes
0 answers
Import file to struct stored in vector
I am having a program which basically employs the data structure struct inside vectors. But I am facing problems when importing data from file. Seems that it doesn't store as the way I expected to.
Thanks so much indeed.
#include
#include…

Casey Chik
- 1
- 3