file-manipulation

Using powershell to merge two folders and rename files based on source folder

北城以北 提交于 2021-02-08 11:21:51
问题 I have a set of files like this: 2015_09_22 |____ foo |____ common.ext |____ common.1.ext |____ common.2.ext |____ common.3.ext |____ bar |____ common.ext |____ common.1.ext |____ common.2.ext I want to merge them into a structure like this, using the source folder name as a string to prepend to the filename: 2015_09_22 |____ foo_common.ext |____ foo_common.1.ext |____ foo_common.2.ext |____ foo_common.3.ext |____ bar_common.ext |____ bar_common.1.ext |____ bar_common.2.ext The format of

Hashmap single key holding a class. count the key and retrieve counter

夙愿已清 提交于 2020-01-02 06:55:08
问题 I am working on a database self project. I have an input file got from: http://ir.dcs.gla.ac.uk/resources/test_collections/cran/ After processing into 1400 separate file, each named 00001.txt ,... 01400.txt ...) and after applying Stemming on them, I will store them separately in a specific folder lets call it StemmedFolder with the following format: in StemmedFolder: 00001.txt includes: investig aerodynam wing slipstream brenckman experiment investig aerodynam wing in StemmedFolder: 00756

How to add extra meta data to PNG?

拈花ヽ惹草 提交于 2019-12-29 07:04:08
问题 is there a way to add some extra metadata to a PNG file and then retrieve it with PHP ? like Comment field. 回答1: If you have ImageMagick installed, it comes with two utilities: mogrify and identify. To add comments: $ mogrify.exe -comment "My test comment" plogo.png To retrieve comments: $ identify.exe -verbose plogo.png | grep -i "comment:" comment: My test comment I don't know if mogrify/identify functions are available as PHP libraries, but you can always use the php system command. 来源:

Script for .SAT (ACIS) files manipulation

大兔子大兔子 提交于 2019-12-25 06:07:29
问题 I need to make a script for ACIS files manipulation, for example: I have 1 SAT file exported from a CAD software with a 3D Model, and i want to create a script in some language (php, python, etc.. even .BAT if it works) that opens the SAT file delete all the components inside my 3D model. I just want the outside of the 3D model. There is some way to do this? becuase i look to the SAT file and it's an ammount of text lines, maybe with a RFC and some tricky tools i can do this.. Any ideia? Best

Copying specific files from multiple sub-directories into a single folder in R

 ̄綄美尐妖づ 提交于 2019-12-20 04:25:13
问题 Assuming I have 3 folders with a large number of files in each, I want to select only a few files from each sub-directory and paste only those files into a new folder. Let's call the 3 folders: desktop/dir/sub_11s_gi01_ab desktop/dir/sub_11f_gi01_b desktop/dir/sub_12s_gi02_ms The files that need to be copied have the extension ".wang.tax.sum" All of the other files cannot be copied and then deleted because it would take days. From other questions, I can combine all the files into a list and

Any reason why an std::ofstream object won't close properly?

自古美人都是妖i 提交于 2019-12-13 16:34:54
问题 I noticed in my C++ code that anytime I close an std::ofstream object I'm unable to reopen the file I closed with std::ifstream . std::ifstream 's open function will always fail. Is there anything 'extra' I can do to ensure that my std::ofstream object closes properly? Someone's probably going to ask to see my specific code so for the sake of keeping this post small I've pastied it here. In my code after running through case a or d all std::ifstream open calls fail. (Prior to posting this

Remove character from file in-place with native Windows tools

折月煮酒 提交于 2019-12-13 04:46:26
问题 I'd like to remove the last character off a large file. The restrictions are that: the file has to be modified in-situ, without using the disk space required for a similar second file it's a windows machine I cannot copy any compiled code onto the machine so I cannot create a small c# program of c++ program to manipulate the file this also means any non-native scripting is not available, like python. As far as I know, this limits me to bat, VB (or JScript) but it does not look like there is a

Does Directory.GetDirectories(path) return full paths or just names?

≡放荡痞女 提交于 2019-12-12 11:42:16
问题 In the MSDN documentation, it says it returns just directory names("Return Value Type: ... An array of type String containing the names of subdirectories in path."), however in their example code, they recurse without concatenating them, so does that mean they return the full paths? i.e. their example code: public static void ProcessDirectory(string targetDirectory) { // Process the list of files found in the directory. string [] fileEntries = Directory.GetFiles(targetDirectory); foreach

NPAPI alternative for live file editing

∥☆過路亽.° 提交于 2019-12-12 02:52:20
问题 I currently have a web app, which allows users to download files to their computers, edit them with their own editors and automatically sends them back to server upon saving and sends some extra data when closing the file. It utilises a Java applet to handle the client side processing which includes file download, sending request to lock the file, opening the file in default desktop app, watching for changes, file upload back to server, sending request to unlock the file upon closing. Since

How to create an undeletable file in Delphi

左心房为你撑大大i 提交于 2019-12-11 07:44:18
问题 [the following is a rephrase of my previous question, which was deemed ambiguous]. I'm digging into creating a basic licensing mechanism for a demo application. What I have in mind goes like that: the application creates an empty "license file" called, say "0b1xa487x.ini" upon the first run, then expires 30 days after it has been first executed and can't be run anymore as long as that specific file is present on the system. What I'm looking for is a method to protect that specific file in a