directory

Checking file names in a directory with entries in an excel spreadsheet; What am I doing wrong?

天大地大妈咪最大 提交于 2021-02-11 17:58:45
问题 I'm attempting to write a PowerShell script (my first ever, so be gentle) to go through all the file names in a directory and check if they exist in an excel spreadsheet that I have. If a file name does exist in both, I want to move/copy that file to a new directory. Right now it runs with no errors, but nothing actually happens. So far I have: #open excel sheet $objexcel=new-object -com excel.application $workbook=$objexcel.workbooks.open("<spreadsheet location>") #use Sheet2 $worksheet =

Moving files to another directory

老子叫甜甜 提交于 2021-02-11 17:19:45
问题 I am trying to move several thousand documents from a list in one column and then move them to the folders listed in the other column, and then finally a third column with what has been moved and what hasn't (there will be errors where the file doesn't exist. I know how to do it on a file by file basis as below: How do I do it for the whole columns though? Sub Copy_One_File() FileCopy "C:\Users\Ron\SourceFolder\Test.xls", "C:\Users\Ron\DestFolder\Test.xls" End Sub Sub Move_Rename_One_File()

How to qsort a dirent in C

元气小坏坏 提交于 2021-02-11 15:26:54
问题 Brand new to C and finding it confusing. What I really want to know about, is taking two separate pieces of code and getting them to work together. Here's some code that simply lists the contents of the current directory: #include <stdio.h> #include <sys/types.h> #include <dirent.h> int main (void) { DIR *dp; struct dirent *ep; dp = opendir ("./"); if (dp != NULL) { while (ep = readdir (dp)) puts (ep->d_name); (void) closedir (dp); } else perror ("Couldn't open the directory"); return 0; }

How to qsort a dirent in C

我只是一个虾纸丫 提交于 2021-02-11 15:25:56
问题 Brand new to C and finding it confusing. What I really want to know about, is taking two separate pieces of code and getting them to work together. Here's some code that simply lists the contents of the current directory: #include <stdio.h> #include <sys/types.h> #include <dirent.h> int main (void) { DIR *dp; struct dirent *ep; dp = opendir ("./"); if (dp != NULL) { while (ep = readdir (dp)) puts (ep->d_name); (void) closedir (dp); } else perror ("Couldn't open the directory"); return 0; }

How to Make Your Computer Change Java Path

耗尽温柔 提交于 2021-02-11 13:00:18
问题 So a while back I installed some .jar files for game mods, which seems to have installed the 1.8 JRE on my computer. Now, I installed JDK 14, however, my computer still thinks that my Java version is 1.8. I have two Java folders on my computer - one in Program Files with the JDK, and one in Program Files (x86) with the old JRE. I set the JAVA_HOME environment variable to the directory of the JDK but when I type java -version in my Command Prompt it still says 1.8. How do I get my computer to

How to Make Your Computer Change Java Path

可紊 提交于 2021-02-11 12:59:07
问题 So a while back I installed some .jar files for game mods, which seems to have installed the 1.8 JRE on my computer. Now, I installed JDK 14, however, my computer still thinks that my Java version is 1.8. I have two Java folders on my computer - one in Program Files with the JDK, and one in Program Files (x86) with the old JRE. I set the JAVA_HOME environment variable to the directory of the JDK but when I type java -version in my Command Prompt it still says 1.8. How do I get my computer to

Moving files into new subdirectory, except for existing folders?

房东的猫 提交于 2021-02-11 12:05:28
问题 A Redditor had written me a great script that allowed me to move all the files in a series of folders into a new subdirectory in all those folders called New. However, I also have pre-existing folders (namely just 1 called "Journals") that have had their files moved into a subdirectory called New, as well. How would I modify the following script (on Windows) to not touch any folders within the folders, or perhaps not touch any folder called Journals? For example, the current directory looks

Powershell - Delete Everything After a Delimiter - In Text files Found in Folder

99封情书 提交于 2021-02-11 11:53:06
问题 I would like to delete content from a bunch of text files. In each text file - Delete Everything After the ****** $Path = "C:\Users\Desktop\Delete\*.txt" # Folder Containing Text files $OutPath = "C:\Users\Desktop\Files\" Get-Content c.txt | Where { $_ -notmatch "*****" } | Set-Content $OutPath I have seen this powershell delete everything after character for every line in a file I couldn't get it to work I am a newbie with power shell do please forgive my code. Thank you 回答1: You can use the

Powershell - Delete Everything After a Delimiter - In Text files Found in Folder

China☆狼群 提交于 2021-02-11 11:53:00
问题 I would like to delete content from a bunch of text files. In each text file - Delete Everything After the ****** $Path = "C:\Users\Desktop\Delete\*.txt" # Folder Containing Text files $OutPath = "C:\Users\Desktop\Files\" Get-Content c.txt | Where { $_ -notmatch "*****" } | Set-Content $OutPath I have seen this powershell delete everything after character for every line in a file I couldn't get it to work I am a newbie with power shell do please forgive my code. Thank you 回答1: You can use the

Listing all sub directories in VB.net

我怕爱的太早我们不能终老 提交于 2021-02-10 19:57:24
问题 can anyone tell me how to list all subfolders in vb.net. i want to put it on a listbox, i have created a code but it only search on the current location, and does not include subfolder. here is my code,, Imports System.IO Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim dnum, fnum As Integer For Each drive As String In Directory.GetLogicalDrives() ListBox1.Items.Add(drive) Next drive Do While dnum < ListBox1