221 questions
0
votes
1
answer
42
views
How to condense the columns of a CSV in Data Factory if a column isn't populated?
I have a Data Factory data flow for consolidating a number of files into a single one, we have a case where the files could be dynamic with different columns that aren't wanted most of the time.
...
2
votes
1
answer
97
views
How to Dynamically Map Directory-Based Identifiers to a Specific Column in Annotated Output Files?
Problem:
I have a two-step bioinformatics pipeline where:
Code 1 generates output files (.marked.bam) and places them into a directory structure.
Code 2 processes annotated files (annotated....
1
vote
3
answers
263
views
How to get slides organized by section in a PPTX using python-pptx?
I'm working with PPTX files in Python, and I need to extract slides grouped by their sections. I'm using the python-pptx library, which works well for general slide manipulation, but it doesn't seem ...
2
votes
1
answer
85
views
Unsuccessful attempt in creating/overwriting a file using fopen
I tried to run the following program:
#include <stdio.h>
#include <stdlib.h>
int main(){
FILE *datei = fopen("employees.txt", "w");
fprintf(datei, "Anna\n&...
0
votes
0
answers
122
views
Converting xlsx file to txt is working! But i have an issue with special characte
I have a code that converts xlsx or csv files to txt files, and it works fine!
However, there is a little issue. When i want it to convert files with special characters like letters in russian, ...
0
votes
1
answer
57
views
Does fstream take a constant character array as a parameter or a dynamic one?
I am trying to send an fstream object to a function, and I provided the name of the file as a string. Now I want to type-cast the string into a character array because fstream takes a character array. ...
0
votes
1
answer
59
views
I'm having trouble with multiple for loop stacking in vb.net
So I've tried all kinds of things. I'm going to post what I have first and then go over the additional stuff I've tried. I know I've got my logistics messed up in some kind of way, but after trying ...
0
votes
0
answers
47
views
Use R to acquire Q1 temp data from individual month files containing daily data (336 files total)
I wish to calculate the mean temperature data for 1 km grid cells from a list of csv files containing 1 km grid cell max and min daily values for individual months.
Here are the numbers of files I am ...
0
votes
1
answer
27
views
nested for loop giving no output when working with two lists
I am making a file sorter in Python and I have two lists. One is called downloads, which holds the names of all of my files in my downloads directory, and the other is called files, which is intended ...
1
vote
1
answer
588
views
Ansible read files line by line and delete lines on condition
Am trying to read a file line by line and delete the line if certain conditions are met
sample input file:
abcd Sat Oct 25 04:30:35 EDT 2036
defg Tue Dec 01 18:59:59 EST 2037
ghij Fri Jun 17 06:15:06 ...
0
votes
1
answer
192
views
Extracting data from multiple PDFs [closed]
I have 200 PDF files, all formatted similarly.
Currently I am opening each PDF and looking for the two relevant values and typing them into an Excel table, all manually.
I'm wondering if there is a ...
1
vote
1
answer
874
views
Is there a way to delete or replace a character in a text file in c
I need to make a C program that removes empty lines as homework
since we didn't study a way to removing characters from files my first attempt was to overwrite all the characters but both fprintf and ...
0
votes
1
answer
62
views
How to efficiently read and delete a specific line of a large file with a custom newline character using Python (3.9 preferred)?
Similar to this question, but slightly more complex
I have a large txt file, that looks something like this:
"
AAAAAAAAAAAAAA.BBBBBBBBBBBBBB.CCCCCCCCCCCCCC.DDDDDDDDDDDDDD.EEEEEEEEEEEEEE....
1
vote
2
answers
139
views
How to replace such column names whose next columns are having all nan values in Pandas
I have a file which has data separated with different spaces and column names are also having spaces.
Type Dec LookupTable Field Name Field Len Start Pos
NUM 0 _ ...
0
votes
1
answer
103
views
How to move files in a other folder with base on a df list
I'm download 20.000 files .png and put in order to specific folder name. Each folder has 1 or 2 .png files.
link of example:
https://drive.google.com/drive/folders/1di8b1L1i1lc2ZKTAWyrNiZNpxMmGcQAH?...
0
votes
1
answer
84
views
Looking for an efficient way to delete a specific portion of a file in C, without copy-pasting it... Read question to understand why
My client-server application simulates a showcase (like a Facebook one). As with every client server application, the server might crash, or go down for electrical deseases or whatever, therefore it ...
2
votes
3
answers
676
views
Find X-largest values in a large file with optional input file command line parsing method in C++
I have a file in the following fixed format:
<unique record identifier> <white_space> <numeric value>
e.g.
1426828011 9
1426828028 350
1426828037 25
1426828056 231
1426828058 109
...
0
votes
1
answer
1k
views
Moving and copying multiple files
I will have list of source path & destination path in excel,
How can I move these files
source
destination
C:/users/desk/1/a.pdf
C:/users/desktop/2
C:/users/desk/1/b.pdf
C:/users/desktop/3
C:/...
1
vote
1
answer
20
views
Running into issues getting os.rename module to work for automation script
Im looping through a file with multiple log files that have been assigned a randomized filename. The script should search within the log for the line containing "hostname" and then pull out ...
1
vote
1
answer
175
views
How can I use Perl for in-place-editing of files with Unix-EOL on Windows?
I am trying to use Perl's in-place-editing feature to change some text in files with Unix line endings in a PowerShell session on Windows:
perl.exe -i'.bak' -p -e "s#PATTERN#REPLACEMENT#g" (...
-2
votes
1
answer
63
views
C - Read input from text file (int,string,int,int)
First of all sorry for any english error.
So, I have this data in a .txt file
Codigo,Produto,StockMinimo,StockAtual
1,Couro,300,1000
2,Tecido,250,2000
...
I want to skip the first line and read only ...
1
vote
1
answer
1k
views
Adding folder name as a prefix to file name in R
I would like to add the folder name in front of all file names being in this folder.
My folder name is TempAir, all file names within this folder are
"201401.tif" "201402.tif" &...
0
votes
1
answer
2k
views
Use Path.GetFileNameWithoutExtension method in C# to get the file name but the display is not complete
This is the simple C# code I wrote :
string file = @"D:\test(2021/02/10).docx";
var fileName = Path.GetFileNameWithoutExtension(file);
Console.WriteLine(fileName);
I ...
0
votes
0
answers
268
views
How can I get all the folders inside my current directory and access their data with javascript?
I have a directory containing a bunch of folders, all having an html,css and js file inside.
I need some way to get like an array of all of these folder in order to access their data and using it in ...
1
vote
1
answer
725
views
Is there a PowerShell equivalent of `paste` (i.e., horizontal file concatenation)? [duplicate]
I want to horizontally concatenate a bunch of CSV files using PowerShell. (When considering possible "duplicate" questions", please not that "a bunch" is not "two".) ...
2
votes
1
answer
262
views
Powershell script that prompts user
How would I go about adding a delete feature to my script that is similar to the rename one? Where it opens up the file browser and allows a user to select a file to delete? Is it possible or do I ...
2
votes
1
answer
708
views
Merge different text files into one Excel file, and delete first column of all but first
I need to merge different text files (.sav files) into one Excel file (output.xls), but starting from the second input file onwards, I want to exclude the first column present in each file.
What I ...
0
votes
2
answers
145
views
PHP - can my script for fetching filenames and finding new files be faster?
I have FTP access to 1 directory that holds all images for all products of the vendor.
1 product has multiple images: variations in size and variations in display of the product.
There is no "...
1
vote
0
answers
829
views
How to open and navigate through Windows folders using Python?
I would like to know how can I open and navigate through folders in the OS in Python the same way I can do it in MATLAB. I have tried using some os functions but none of them seems to make a lot of ...
0
votes
1
answer
1k
views
replace first character of each line in file python
I am trying to replace some of the first characters in lines from multiple txt files and have this code but the output is wrong:
for filename in glob.glob('./labels/**/*.txt', recursive=True):
with ...
-1
votes
1
answer
3k
views
json.dump doesn't dump anything, and leaves me with an empty file | Python
I have been trying to dump a dictionary into my JSON file with the json library. However, when I dump, the file doesn't show anything inside it. Furthermore, when I read the file (using open('file')....
0
votes
2
answers
995
views
How to manipulate text file in C++
I have a txt file with the following data (inputFile.txt):
Start
FX
FX
FX
FX
End
What I am trying to achieve is to have the FX replaced by TL and BQ so that I have both repeated equally 4 times ...
2
votes
2
answers
99
views
File Manipulation with pandas
I am a beginner in manipulating files, hence I haven't got a full grasp of it. What I want to do is, by using pandas, create a new file that has all the elements of a previews one listed based on ...
0
votes
0
answers
769
views
How to cast string to byte like object
I am trying to make a python script that encodes any file into a txt file. So far I can encode an input file into a txt file that contains the original files name, content and a sha hash for integrity ...
1
vote
1
answer
1k
views
How should do you update JSON values of keys which are themselves values, with python
I have 2 files, one a test.json and the other my test.py
My goal is to have the value of the key "test3" update and instead of being equal to a 3(like how it is shown below), update and turn ...
0
votes
1
answer
540
views
Remove Thumbnail from MP3 FILE - from yt-audio
When using yt-audio, how can you remove the thumbnail image (artwork / screenshot) that comes with the downloaded mp3 file?
Best would be to have a way of doing it by adding an additional argument to ...
0
votes
1
answer
832
views
Renaming Files By Adding Numbers Prefixes In File Names
I have a list of files which have number prefixes e.g 1-filename.txt 2-filename.txt ..so on . I found that I skipped a file name as 45-filename.txt . I have files from 1-filename.txt to 100-filename....
0
votes
0
answers
41
views
Use file pointer in insert mode, not overwrite mode in PHP
I have noticed that in PHP (7.x), when you write to a file, it overwrites any existing characters. For example,
$file = fopen("test.txt", "r+");
/* test.txt contains
abc123
*/
...
0
votes
1
answer
278
views
PowerShell - Why is this not renaming my files?
I have been looking around for a way to quickly and easily rename hundreds os files in one go.
something where I only have to change smalle parts for it to be reused somewhere else.
So i ended up ...
1
vote
1
answer
1k
views
python loadtxt from many files, appending into the same numpy arrays
I'm new to python and want the most pythonic way of solving the following basic problem:
I have many plain-text data files file.00001, file.00002, ..., file.99999 and each file has a single line, with ...
0
votes
4
answers
2k
views
How can I print the line index of a specific word in a text file?
I was trying to find a way to print the biggest word from a txt file, it's size and it's line index. I managed to get the first two done but can't quite figure it out how to print the line index. Can ...
5
votes
3
answers
5k
views
Delete unecessary .keep files
I noticed my git repository has a lot of .keep files. They were once useful when their parent directories were otherwise empty, but since then a lot of the directories now have real children that keep ...
-1
votes
1
answer
257
views
How to get Path and name of the Uploaded file in Node.js
Well I am creating a react based web application in which I want to upload docx/pdf and convert it to pdf/docx. For security reason there is no way to get file path in react. I wanna use libreoffice-...
0
votes
1
answer
747
views
Do I need to sanitize $_SERVER['argv']? How?
I tested my PHP application for vulnerabilities, with Checkmarx. I got File Manipulation error in $_SERVER['argv'].
$argv = $_SERVER['argv'];
if (count($argv) < 3) {
echo "Usage: "....
5
votes
2
answers
7k
views
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....
-5
votes
2
answers
118
views
count letters and words in a file with python [closed]
The code should read the text from the file "input.txt" and then count the number of letters and words in each line, and then write the output to a new file named "output.txt"
I need help with ...
0
votes
2
answers
247
views
How to remove duplicates in my python script?
I have used a regex search to filter down some results from a text file (searching for ".js") which has given me roughly around 16 results some of which are duplicates. I want to remove duplicates ...
1
vote
0
answers
679
views
PyLint detect undefined variables that are defined and used in if statement or with ... as statement inside a class definition
I was doing some analysis about the Coronavirus and PyLint detect some undefined variables that are defined in an if statement or by a with statement. my code work as expected and is see no errors or ...
0
votes
2
answers
4k
views
CheckMarx - File Manipulation Vulnerability - php
my code essentially takes a file uploaded to the server using a front end, by referring to the the $_FILES variable in php, and moves it to a new file on the server . Following snippet summarizes the ...
0
votes
0
answers
102
views
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 ...