filenames

How to rename files with a specific pattern in R?

99封情书 提交于 2019-12-09 00:00:54
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 8 years ago . There are some .fcs files in a data.000X format (where X = 1, 2, 3...) in a directory. I want to rename every n file to the following format: exp.fcs (where exp is a text from a vector) if the file to be renamed is an .fcs file. in other words : I want to rename files to exp.txt, where exp is a text and not a consecutive letter(s) i.e. F, cA, K, etc. For example, from: data

Preferred (or most common) file extension for a Python pickle

徘徊边缘 提交于 2019-12-08 15:38:28
问题 This is a question from a student that I didn't have a good answer for. At times, I've seen .pickle , .pck , .pcl , and .db for files that contain Python pickles but am unsure what is the most common or best practice. I know that the latter three extensions are also used for other things. The related question is what MIME type is preferred for sending pickles between systems using a REST API? 回答1: Python 2 From the Python 2 docs: output = open('data.pkl', 'wb') I would choose .pkl as the

Remove last two digits of filename [closed]

巧了我就是萌 提交于 2019-12-08 15:27:43
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . How can I remove the last two characters of a filename in PHP? http://www.nws.noaa.gov/weather/images/fcicons/tsra50.jpg # becomes http://www.nws.noaa.gov/weather/images/fcicons/tsra.jpg and http://www.nws.noaa.gov/weather/images/fcicons/hi_shwrs60.jpg # becomes http://www.nws.noaa.gov/weather/images/fcicons/hi

C# .cs file name and class name need to be matched?

依然范特西╮ 提交于 2019-12-08 14:36:04
问题 In Java the file name must be the public class name defined in that java file. Does C# has similar requirement? can I have a A.cs file which only defines a public Class B inside? thanks, 回答1: No, there is no similar requirement. Yes, you can do this. It is considered bad practice, however. Microsoft StyleCop will warn you if you do this, but everything will compile fine. 回答2: No, there is not a requirement that the filename matches a single public class being defined in the file. In fact, it

Find if last two characters in filename are numbers [closed]

青春壹個敷衍的年華 提交于 2019-12-08 14:20:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I want to see if the last two characters/digits in a filename are numbers in PHP. if (CODE HERE) { // runs script because last two characters are numbers } This should set it off: http://www.nws.noaa.gov/weather/images/fcicons/hi_shwrs20.jpg The last two digits are '20' This should not: http://www.nws.noaa.gov

How to pass a path as argument to shell script and copy a file from the path

廉价感情. 提交于 2019-12-08 13:40:54
问题 I've written bash script to open a file passed as argument and write it into another file. But my script will work properly only if the file is in the current directory. Now i need to open and write the file that is not in the current directory also. If compile is the name of my script, then ./compile next/123/file.txt should open the file.txt in the passed path. How can I do it? #!/bin/sh #FIRST SCRIPT clear echo "-----STARTING COMPILATION-----" #echo $1 name=$1 # Copy the filename to name

How to create a timeline chart control thing?

随声附和 提交于 2019-12-08 08:55:50
问题 I am trying to create a timeline, and have been trying to use chart control. but it is not working out as i only need the X value and the chart series is like, only AddY or AddXY, there's no AddX/AddXX2. I know there's like, questions like this before and stuff. There's this person that asked How to create a timeline control? like, 3 years ago but i'm not sure what exactly they are saying in the answers and comments.. My current code is: DirectoryInfo dInfo = new DirectoryInfo(tbSelectFolder

C#/.NET Server Path to default/index page

时间秒杀一切 提交于 2019-12-08 07:35:49
问题 In my attempt to further future-proof a project I am trying to find the best way to retrieve the full path and filename of the index/default page in a web directory using C# and without knowing the web server's list of filename possibilities. 'Server.MapPath("/test/")' gives me 'C:\www\test\' ...so does: 'Server.MapPath(Page.ResolveUrl("/test/"))' ...but I need 'C:\www\test\index.html'. Does anyone know of an existing method of retrieving the filename that the webserver will serve up when

Change default filename in SaveAs Dialog

风流意气都作罢 提交于 2019-12-08 06:17:35
问题 I am trying to change the proposed filename within the " Save As "-Dialog based on the content of a Content Control. My understanding was that Word is proposing the Document Property „ Title “ within the SaveAs Dialog. Within an empty Document I created a Content Control (Text only) and put the following code in "This Document". Private Sub Document_ContentControlOnExit(ByVal objCC As ContentControl, _ Cancel As Boolean) ActiveDocument.BuiltInDocumentProperties("Title") = objCC.Range.Text End

How to recursively convert all filenames in folder subtree from UTF-8 to ASCII in Linux

冷暖自知 提交于 2019-12-08 04:13:10
问题 I'm quiet new to bash scripting, and I would like to convert recursively all my filenames in folder from UTF-8 encoding to ASCII (which is very portable encoding). I think that iconv command would be of some use: iconv -f utf8 -t ascii ... But I'm not sure how to use it exactly. At best the bash script should print some hint about it's progress, like name of file it just converted. Thank you very much. 回答1: find /my/path -type f > utf8list iconv utf8list > asciilist i=1 for file in $(cat