Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
extract 1st file in directories
Name: Infina Date: February 7, 2009 at 12:53:56 Pacific OS: Windows Vista Subcategory: Batch
Comment:
I've been pulling my hair out for the past couple days, learning dos commands and batch scripting so here's the story: I have nested directories of .cbr's (rar'd comic files) and I would like to extract ONLY the 1st file in each one (being the cover page of each comic) to a specified folder.
Name: Judago Date: February 7, 2009 at 15:28:21 Pacific
Reply:
Is there anything unique in the file names like "part 1" or something similar? Also how do you define "specified folder" because you have not specified it here; will each title page go into it's own folder or will they all go into a communal "title page folder"?
0
Response Number 2
Name: Infina Date: February 7, 2009 at 15:39:17 Pacific
Reply:
I'm trying to use the 7z command line and the pics can all go to 1 communal folder. I have no preference. I have code to extract the 1st file names, but no way to tell 7z to extract only those files. Or maybe I'm not understanding the include switch correctly... Here is my code thus far: for /f "tokens=*" %%a IN ('dir /b "x:\comics\"') do 7z l "x:\comics\%%~nxa" -r -aot | find /i ".jpg" > x:\temp.txt && call x:\head.bat 1 x:\temp.txt >> x:\firstfile.txt
Basically, 7zip accepts the archives' filenames, outputs the list of files in each archive, looks for lines with only ".jpg" then sends it to a temp.txt. Head.bat is a batch that reads the 1st line off a text file, so it reads the first line (being name of 1st file in the archive) and outputs it to firstfile.txt which collects the 1st filenames in each archive. At this point I'm stuck because when I use this file with 7zip, it says there are no files to process. However, a program called PowerArchiver can read this file, but can't use it to unzip 7z files. sigh
Summary: DriveListBox Control - Used to select drive DirListBox Control - Used to select directory on drive FileListBox Control - Used to list files in directory Note: you need to synchronize changes in driv...
Summary: I want to list files and directories in a given directory with gcc (linux). SO I need a variable DIR my_dir; an further with diropen, dirclose, rewdir an so on. But while compiling it sais something l...
Summary: I have directory of files that are named, for example, page1.txt, page2.txt,...I have a lot of them (more than 1000). When I use File f = new File("path_to_directory"); String[] list = f.list(); I get...