w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to decompress a .xz file which has multiple folders/files inside, in a single go?
Python 3.3 import tarfile with tarfile.open('test.tar.xz') as f: f.extractall('.') Python 2.7 Need lzma in Python 2.7 import contextlib import lzma import tarfile with contextlib.closing(lzma.LZMAFile('test.tar.xz')) as xz: with tarfile.open(fileobj=xz) as f: f.extractall('.')

Categories : Python

Delete multiple files or folders from a CSV file that contain more than one columns (Powershell)
First I would remove the type information from your CSV like so: Import-Module ActiveDirectory Get-ADUser -SearchBase "OU=Marked for Deletion,OU=Disable Users,DC=******,DC=com" -Filter * -Property * | Select-Object -Property homeDirectory,profilePath | Export-CSV -Path .Remove.csv -NoTypeInformation Then for your delete code I would use this: Import-Csv "C:lab emove.csv" | % { Remove-Item -Path $_.homeDirectory -force -Recurse Remove-Item -Path $_.profilePath -force -Recurse } write-host -foregroundcolor yellow "Delete action complete" The problem with your code is that you are not looping through a column, you looping by line and then doing it twice. To do it your way you would need to split the line at the comma.

Categories : Powershell

Batch: Create a list of folders and then copy multiple files/folders into all of them
Try this: @echo off &setlocal cd /d "RootFolder=X:folder omy data" for /d %%a in (*) do xcopy "_TEMPLATE" "%%~fa" /sihrky For xcopy options see xcopy /?, to test the command without writing add option /l.

Categories : List

Move multiple files from multiple folders to one folder
How far have to got with this ? Have you managed to get them moving from one folder to another yet ? Is it an issue with the sub-folders ? I had a similar issue before and i found this answer really helped me : move files between folders

Categories : Windows

Upload multiple files using php to different folders
Create a form with two file fields. Get the fields in PHP and then save the files. Take a look at: http://php.net/manual/en/features.file-upload.php

Categories : PHP

Ant - How to search for files in multiple folders
The testplans element is, according to the JMeter docs, a standard Ant fileset, so you can do anything described in the Ant fileset docs. The single asterisk (*) is a placeholder for a single directory, whereas the double asterisk (**) signifies any number of subdirectories (docs). For example (I am not sure if I understand your question correctly), you could define a fileset like this: <testplans dir="JTesting" includes="*/jmxFiles/*.jmx"/> This would assume directories like this: JTesting/basket/jmxFiles/foo.jmx. It also assumes that your ${basedir} is C:/Users/MURPHYA1/Desktop. If it is not, use an absolute path or ${jtesting-home} for the dir attribute.

Categories : Search

Merge Files over multiple folders using PowerShell
Assuming that all CSVs have the same columns something like this should work: $root = 'C:path oRoot_dir' $csv = 'C:path ooutput.csv' Get-ChildItem $root -Filter 'message.csv' -Recurse | % { Import-Csv $_.FullName } | Export-Csv $csv -NoTypeInformation To remove duplicates from the output try this instead: $root = 'C:path oRoot_dir' $csv = 'C:path ooutput.csv' Get-ChildItem $root -Filter 'message.csv' -Recurse | % { Import-Csv $_.FullName } | ConvertTo-Csv -NoTypeInformation | select -Unique | Out-File $csv

Categories : Powershell

copy files of multiple folders and rename them with cmd
try this: @ECHO OFF &SETLOCAL ENABLEDELAYEDEXPANSION SET "startfolder=c:data" SET "targetfolder=x:data" for /d /r "%startfolder%" %%a in (*) do ( SET "fname=%%~a" SET "fname=!fname:%startfolder%=!" ECHO MD "%targetfolder%!fname!\%%~nxa" 2>nul for %%b in ("%%~fa*") do ECHO COPY "%%~fb" "%targetfolder%!fname!\%%~nb-new name%%~xb" ) Look at the output and remove the word echobefore MDand COPY if it looks good.

Categories : Batch File

How to include multiple class files and .Jar files in class path which exist in sub folders in linux?
Use below command: export CLASSPATH="$CLASSPATH:xyz.jar**:**path_to_abc.jar.jar" You basically have to append to the classpath, all the new entries that you want. To do so, just make use of ':' in linux and ';' in windows.

Categories : Java

Export changed files & folders from multiple commit
The only commands which comes close would be git archive, for which you can specify a list of path you want to export in a (zip or tar) archive, you could un-archive elsewhere. But that isn't a convenient way to get only the files you need. The other way would be to: clone your local repo delete all the files not listed your git diff output Actually, an easier way would be to copy each file from the git diff with their path. See "linux: copy and create destination dir if it does not exist" cp --parents a/b/c existing_dir copies the file 'a/b/c' to 'existing_dir/a/b/c', creating any missing intermediate directories.

Categories : GIT

Mass move files from within multiple folders with java
Take a look at FileUtils in commons-io.

Categories : Java

Upload multiple files with wpf progress bars
Your UploadProgress-class has to implement INotifyPropertyChanged, to notify the binding when it's value changes. Now you just have to change the Percent-value of some UploadProgress-instance in your list to change the corresponding ProgressBars value. Maybe you create a method which sets the Percentage value, like: private void Upload(UploadProgress upload) { byte[] uploadBytes = File.GetBytes(upload.File); step = 100/uploadBytes.Length; foreach (byte b in uploadBytes) { UploadByte(b); upload.Percent += step; //after you implemented INotifyPropertyChanged correctly this line will automatically update it's prograssbar. } } I really don't know how a upload works in detail, so this method is just to show you how you could handle the percentage value

Categories : C#

How to download, zip and save multiple files with Javascript and get progress?
I was reminded of this question.. since it has no answers yet, I write a possible solution in case it can be useful to someone else: as said, the first problem is with passing blob url to jszip (it does not support blobs but it also does not throw any error to notify that and it successfully generates an archive of corrupted files): to correct this, simply pass a base64 string of the data instead of its blob object url; the second problem is with file name synchronization: the easiest workaround here is to download one file at a time instead of using parallels xhr requests. So, the modified upper code can be: var fileURLs = ['http://www.test.com/img.jpg',...]; var zip = new JSZip(); var count = 0; downloadFile(fileURLs[count], onDownloadComplete); function downloadFile(url, onSucce

Categories : Javascript

Hadoop HDFS Copy Files from multiple folders to one destination folder
There is DistCp which is an map-reduce job which copies files from one or multiple source folders to one target folder in an parallel manner. However, its not merging files. But maybe you could use filecrush to do that! (let me know how this goes!)

Categories : Hadoop

Terminals - Creating Multiple Identical Folders within Subdirectories and Moving Files
I will assume you are using bash, since it is the default shell in OS X. One way to do this uses a for loop over each directory to create the subdirectory and move the file. Wildcards are used to find all of the directories and the file. for DIR in Cars/*/ ; do mkdir "${DIR}Pricing" mv "${DIR}payment*.html" "${DIR}Pricing/" done The first line finds every directory in Cars, and then runs the loop once for each, replacing ${DIR} with the current directory. The second line creates the subdirectory using the substitution. Note the double quotes, which are necessary only if the path could contain spaces. The third line moves any file in the directory whose name starts with "payment" and ends with ".html" to the subdirectory. If you have multiple files which match this, they will all

Categories : Osx

How to recursively zip utf-8 files and folders from a batch file?
Windows's ZIP file shell extension (“Compressed Folders”) doesn't support Unicode filenames. Instead it takes the byte filename string and interprets it using a locale-specific legacy encoding (which varies from machine to machine and is never a UTF). It looks like you've got some further mangling in the zipping-up process too as it doesn't look like a straight UTF-8 misinterpretation; you could get a better idea of what the filenames are in the ZIP by using another tool that does support Unicode to open it (eg 7zip). But the point is likely moot: if you are expecting the consumers of the ZIP file to be Windows users, the only safe filename characters are ASCII.

Categories : Windows

Moving files from a plugin into folders using an XML file
Read the link below. It contains details how to create the XML. http://docs.joomla.org/J1.5:Components:xml_installfile http://docs.joomla.org/J2.5:Developing_a_MVC_Component/Developing_a_Basic_Component XML may differ depending on the Joomla version you are using. Please search on Google get the particular XML. Install the component with the new files. It will update the existing files as you need.

Categories : Xml

How to stop threads of following type in Java used for watching folders for files using WatchService for folders by using jToggleButton
There is a Thread.stop() method, but is has been deprecated, because it's unsafe. Instead of using the deprecated method(s), you can modify some variable to indicate that the target thread should stop running.

Categories : Java

Android Download Multiple Files and show progress in ListView
When starting download you can use the reference of progress-bar and update it using a handler. Asynctask would not be a good idea for you. You should read this before jump deep with Asynctask. For long lasting background operation you should look into Service. [IntentService] is a good candidate for this as its uses queue to keep track of multiple request. Boundservice this case good option. Alternatively if you want more control on thread pool and on execution you can think of writing your own downloader using a blocking queue and Executor, where you will be able to control number of thread and queue size

Categories : Android

MATLAB: Opening and Editing Files nested in folders in folders
Check out subdir! On the file exchange, its an awesome function that can return all folders and all files in expansive subfolders, and you can filter file names by extension and whatnot. http://www.mathworks.com/matlabcentral/fileexchange/15859-subdir-a-recursive-file-search

Categories : Matlab

Move files in folders dependent on the file date
try this and remove the echo if the output is OK: @echo off &setlocal for %%i in (Extract_*.dat) do ( set "fname=%%~i" setlocal enabledelayedexpansion set "name=!fname:*_=!" set "year=!name:~0,4!" set "month=!name:~4,2!" set "day=!name:~6,2!" echo move "!fname!" "Archive!year!!month!!day!" endlocal )

Categories : Windows

How to acess list of files and folders in a zip file in java?
You need to use the ZipFile class, e.g. like ZipFile zipFile = new ZipFile(strFilePath + ".zip"); Enumeration<? extends ZipEntry> entries = zipFile.entries(); while(entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); System.err.println(entry.getName()); } See also List Contents Of Zip File Example.

Categories : Java

How to recursively retrieve files from folders returning file name and its Folder name
You may want to use folderFullPath.lastIndexOf(File.separator) in order to find the index of the character before the folder name and then use substring to extract the folder name from the full-path.

Categories : Java

Windows batch - Move files to folders based on file name & extension
EDITED to use different destination folders. Don't use a - in the batch filename if you plan to use it in the same folder. Try this. It uses the first - in the filename as the delimiter, removes the last character which is a space, makes a directory if it needs it or not, and moves the files into the appropriate folder. Filenames containing ! and % could be an issue. @echo off cd /d "c:To-Process" setlocal enabledelayedexpansion for %%a in (*-*.*) do ( for /f "delims=-" %%b in ("%%a") do ( set "f=%%b" if /i "%%~xa"==".pdf" ( md "C:/documents/sales/pdf/!f:~0,-1!" 2>nul move "%%a" "C:/documents/sales/pdf/!f:~0,-1!" >nul ) if /i "%%~xa"==".xlsm" ( md "C:/documents/sales/excel/!f:~0,-1!" 2>nul move "%%a" "C:/documen

Categories : Windows

Run a batch file that would delete files in a folder (and its sub folders) that are older then 30 days
I did some copy and paste for you from here: forfiles -p "C:whatever" -s -m *.* /D -30 /C "cmd /c del @path" See forfile documentation for more details.

Categories : Windows

Multiple File Upload With ProgressBar in Flash Action script with preview of image and individual progress bar for each file
You have the array of FileReferences, and you do not have an array of progress bars. So, to answer your questions: To add a set of progress bars, declare a class (say a MovieClip base, but a Sprite can do), name it say MyProgressBar, define visuals etc, define a function that will adjust it, and add an instance of it to a set like this: var myBars:Vector.<MyProgressBar>; function fileSelectHandler(event:Event):void { for (var i:int=0;i<fileRef.fileList.length;i++){ ++totalFiles; var myNextBar:MyProgressBar=new MyProgressBar(); myNextBar.y=i*MyProgressBar.theHeight; myBarHandler.addChild(myNextBar); myBars.push(myNextBar); uploadSingleFile(fileRef.fileList[i]); } } This way each element in fileRef.fileList will

Categories : PHP

How to make a batch file to execute win rar in multiple folders
@echo off ( echo c:projects est echo c:wwwsite echo c:logsoffice )>list.txt "%programfiles%winrar ar" a "c:ackup\%date:/=-%_backup.rar" @list.txt If you are on Win-x64 set the rar path: "%programfiles(x86)%winrar ar"

Categories : Batch File

PHP copy a file to multiple child folders with random names
It is sad I cannot comment so go on... //get the new folder name $newfolder = $_POST['newfoldername']; //create it if not exist if(!is_dir("./$newfolder")) { mkdir("./$newfolder", 0777, true); } //list all folder $dirname = './'; $dir = opendir($dirname); while($file = readdir($dir)) { if(($file != '.' OR $file != '..') AND is_dir($dirname.$file)) { //generate a randomname $str = 'yourmotherisveryniceABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; $randomname = str_shuffle($str); $actualdir = $dirname.$file; //copy of the file copy($uploadedfile['tmp_name'], $actualdir.$randomname); } } closedir($dir); I just want to say, you seem to be lazy by looking for what you want to do. because when I read "I would like to write a

Categories : PHP

Trouble creating multiple folders from a TXT file in Windows PowerShell or CMD?
The "workaround" for the "`Set-ExecutionPolicy error'" is to set the execution policy to allow scripts to run. See http://technet.microsoft.com/en-us/library/ee176961.aspx . It's set to the most restrictive by default but any admin worth his salt will set it to something less restrictive based on what the environment requires. Once you've done that, your script looks solid.

Categories : Windows

2 Progress Bars for multiple file downloads
To have a second progress bar that tracks total bytes downloaded: Prior to showing the download screen, determine the total number of bytes to be downloaded. The specifics here depend on the download mechanism, but most FTP and HTTP servers will provide file sizes. In cases where they don't you'll have to make a reasonable estimate. Store this in an accessible member variable. Create an accessible member variable for the total number of bytes downloaded. Bind this to the same routine that updates your single-file progress, so that each download "tick" also accumulates the "number of bytes downloaded" field in addition to the percentage of the current file as it does now. Bind the total number of bytes to the "total percentage" progress bar maximum value. Bind the bytes downloaded counte

Categories : Vb.Net

JQuery File Upload and Carrierwave to Detect Folders and Sub Folders
I don't think this is possible. See here: http://www.codeproject.com/Questions/573788/HoeplustoplusGetplustheplusOriginalplusfilepluspat It appears that you can't know the context of the uploaded file on the source operating system. Therefore you can't create it's original parent folder structure on your system.

Categories : Jquery

Batch file creating folders in all folders of current directory
Total rewrite of answer. This will make a "Outlook Archive" folder in only the DataMy Documents subfolders of wherever the batch file resides. for /f "delims=" %%i in ('dir /ad/s/b') do if EXIST "%%iDataMy Documents" MKDIR "%%iDataMy DocumentsOutlook Archive" pause Credit to here

Categories : Windows

Google drive: Get (root) file and folders with javascript api (get only deleted files on drive)
Same situation as following question: google drive api, javascript list files returns nothing I needed to add to the scope the path 'drive' at authorizing, I had only drive.file which is intent to create/edit files only. The weird thing is that the API returns deleted files when you don't have permissions to view files, I think it's a bug in the API (a serious one). Post this bug on google drive: https://productforums.google.com/forum/#!searchin/drive/security$20issue$20permission$20view/drive/pupjKxTz9FU/cUarGIl_Ah0J

Categories : Javascript

Select multiple files (different files from different directory) with 1 input type file element.
Using more than one <input type="file" /> element for your form is the best you can do. It's not possible to select multiple files from different directories in a single upload dialog.

Categories : HTML

Error in creating .so file from .o files generated using multiple .c files
The problem is that you're linking the object files, not just compiling them. Make sure that you only compile the files, don't link them! You do that using the -c option. Do not use the -l option, you don't want to link anything at this stage. So: gcc -c -o usb_comm.o usb_comm.c gcc -c -o hex2bin.o hex2bin.c gcc -c -o hex_read.o hex_read.c gcc -c -o crc32.o crc32.c (I omitted the -I flags to save space here.) Then finally link all those object files into a shared library, and link against usb-1.0: gcc -shared -o libhello.so usb_comm.o hex2bin.o hex_read.o crc32.o -lusb-1.0 You should use a Makefile though for this. Or, even better, use a proper build system, like CMake, which is very easy to use. It's provided by all common Linux distros, so simply install it with the package man

Categories : C

Multiple Build Folders (multiple clients, mulitask, multiple targets) using Grunt (Yeoman)
There's really no best practice out there beside what's recommended for PG 3. For multiple clients, you may want to modify your gruntjs. This is my project structure, where assets folder contain data for different clients: And here is my gruntjs file. It use ImageMagik to create all the necessary launcher icons. Build and deploy for over the air installation. You get the idea... /*** * Package script for MobileStore ***/ 'use strict'; // require package.json: /* { "name": "MobileStore", "version": "1.0.1", "devDependencies": { "grunt": "~0.4.1", "grunt-contrib-jshint": "~0.6.0", "grunt-contrib-clean": "~0.4.1", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-concat": "~0.3.0", "grunt-exec": "~0.4.2", "grunt-string-replace": "~0.2.4", "grunt

Categories : Javascript

Execute multiple .py files at the same time
If you want to use multiprocessing, you can try this: import multiprocessing def worker(file): #your subprocess code if __name__ == '__main__': files = ["path/to/file1.py","path/to/file2.py","path/to/file3.py"] for i in files: p = multiprocessing.Process(target=worker(i)) p.start()

Categories : Python

How to use grep command on multiple files at same time?
Do yourself a favor and install ack. You'll rarely use grep after that. ack: automatically recurses into subdirectories treats search parameter as a Perl regular expression rich set of command-line options more powerful and DWIMmy than grep Install by installing the App::Ack distribution from CPAN

Categories : Perl

running multiple files on node js at the same time
This is normal behavior. Node will only exit if there's nothing more to do (or if you manually stop it via Ctrl+C). Since you told http to listen(), the process will stay alive indefinitely. It's not exactly clear what you're asking, but if you want to run additional files inside your app, you simply require() them. var otherFile = require('./otherFile.js') // the .js is optional otherFile will now be set to whatever you do to module.exports in otherFile.js. You should read the module documentation to get a full understanding of how require works. If you want to run other unrelated files with node at the same time, open a separate command prompt window. I will now read between the lines a little: it looks like you might be wondering how to get http to serve files from disk like

Categories : Javascript

Media player playing multiple files at the same time
Before it's start consider doing the following: if(mPlayer.isPlaying()) mPlayer.stop(); mPlayer.start(); Implement it inside your if statements and see if it works for you! But for this to work you have to define your MediaPlayer object in a wider Scope and not declaring everytime a new MediaPlayer object.

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.