directory

Bash Directory Sorting Issue - Removing Duplicate Lines?

本秂侑毒 提交于 2019-12-12 02:56:28
问题 I'm using this command to merge multiple identical directories and to remove duplicate lines from each of the corresponding files: for f in app1/*; do bn="$(basename "$f")" sort -u "$f" "app2/$bn" > "app/$bn" done Is there a way to edit this so that it checks the lines of all the files and removes all the duplicates as well? I do need to keep the existing file structure with individual files. The end result creates a directory with 300 text files that's no larger than 30mb. Example: *

Perl Directory Walking issue - Can't go back up more than 1 directory properly

放肆的年华 提交于 2019-12-12 02:55:59
问题 First off, I don't have the ability to use File::Find. So I have my script to walk through directories and find a certain type of file. But if I go more than one sub-directory deep, my script doesn't properly exit all the way back up to the starting directory. I think I need to have a $previousDir variable that keeps track of the last directory so I can say to go back out to that one when I'm done in the sub-directory. But I've tried putting it in multiple places without success... File

Server.MapPath - Could not find a part of the path in ASP.net

倖福魔咒の 提交于 2019-12-12 02:53:59
问题 I am uploading a file to my server using Server.MapPath When I run my code I get the following error Could not find a part of the path 'C:\inetpub\wwwroot\wss\VirtualDirectories\80\SitePages\uploads\ABI Employee List.xlsx'. So Yes, I dont have that directory on my server. I only have a directory up to here. 'C:\inetpub\wwwroot\wss\VirtualDirectories\80\ So, I go and create Those directories. The weird thing is, is that if I create a folder with the name "SitePages" in the above directory, my

Creating subdirectories within a directory and be able to save data into it

China☆狼群 提交于 2019-12-12 02:52:47
问题 I'm new to android developing, and I'm in need of help. I've got two problems which are: I don't know how to create two subdirectories inside my main directory. I know how to create subdirectory inside of a directory ( File directory = new File(Environment.getExternalStorageDirectory()+"Saling-Wika/Audio&Text Files"); ), but what I do want is there would be two subdirectories inside of my main subdirectory (The Audio Files & Text Files are different two subdirectories inside the Saling-Wika

Creating folders and writing files to external storage

孤街浪徒 提交于 2019-12-12 02:44:32
问题 I am trying to create a directory and then write data into a new file on an external SD card. I have previously written files successfully to internal storage, but with this I seem to have 2 problems (well, apart from myself, as this is only my second app!). Having searched at length on stackoverflow for advice and sample code, I have built the following method: void filewriter(String fnam,String mdata){ if (useSD) { //test to see if a directory called AMJ exists on external storage and

Batch to move folders that are 30 days old using FORFILES

蓝咒 提交于 2019-12-12 02:42:09
问题 I am currently working that moves ONLY folders from one directory to a folder. The current bacth file I have created is as follows. Set /p target=Select Target Destination: ForFiles /P "C:\Batch test" /D -4 /C "CMD /C if @ISDIR==TRUE echo Move @FILE %target%" &Move @File %target% pause The problem I have is with using a target directory that has a space in it for instance "C:\Move Test". I was wondering if there was a way to still move folders to another directory that has a space in the name

FFMPEG - I'm trying to use ffmpeg to select all the .mp4 files in a folder and screenshot them with the file name as the image name

☆樱花仙子☆ 提交于 2019-12-12 02:32:33
问题 I have never dealt with .bat files before so this is new to me. I'm trying to use FFMPEG to select all the .mp4 files from a folder I place the .bat file in. Then to get it to screenshot every 30 minutes, and output the files with the input file name + image number in JPEG This is what i came up with so far: for f in *.mp4; do ffmpeg -i "$f" -vf fps=1/1800 "${f%.mp4}.jpeg";done && cp --copy-contents *.jpeg ~*outputDirectory* && rm -R *.jpeg Any help would greatly be appreciated. 回答1: If I'm

Why can't I find a file in Python 2.7 on Mac OS X 2.7.5?

核能气质少年 提交于 2019-12-12 02:15:39
问题 Using the following code: fileName = 'Data\\all_earthquakes.csv' with open(fileName, 'rb') as csv_file: attrHeaderRow = csv_file.readline().strip() I get the following error: IOError: [Errno 2] No such file or directory: 'Data\\all_earthquakes.csv' Works perfectly fine on my Windows 7 machine. 回答1: Windows and Mac OS X use different characters to separate elements in paths. Windows uses the backslash, Mac OS X (and Linux/UNIX) uses the forward slash. Python takes care of this for you: use os

How to use SimpleHTTPServer?

流过昼夜 提交于 2019-12-12 02:07:48
问题 I'm trying to start a simple http server with the most recent version of Python 2.7. I'm following a tutorial and it instructs me to do the following: Open the Terminal then navigate to our client directory and enter the following command: $ python -m SimpleHTTPServer But no matter what I've tried, including other codes, it doesn't work. Can anyone help please? It always puts a syntax error such as: '$' is not recognized as an internal or external command, operable program or batch file. If I

Use htaccess to rewrite subdomain files to a folder

蓝咒 提交于 2019-12-12 02:07:31
问题 I need to rewrite a files on subdomain to files stored in the folder with name of the subdomain. Only files that start with sitemap should be rewritten. So, if the requests look like this: http://demo.domain.com/sitemap.xml http://demo.domain.com/sitemap_more.xml http://test.domain.com/sitemap.xml http://test.domain.com/sitemap_alpha.xml These should rewrite to files: /content/sitemaps/demo/sitemap.xml /content/sitemaps/demo/sitemap_more.xml /content/sitemaps/test/sitemap.xml /content