filenames

Reading a file name from piped command

廉价感情. 提交于 2019-12-01 12:38:15
So I'm trying to get the C program to read a filename from the command line in the following format: cat (filename path) | (program name) i can get it to read the name of the input file when its entered as a command line argument, but it won't read from the concatenated argument here's the code, right now its reading the name of the file as if written after the program name on the command line. #include <stdio.h> #include <string.h> //initialize file pointer FILE *file; //initialize global variables #define DEFAULT_LEN 70 //main int main(int argv, char *argc[]){ //open File for reading file =

using quotes in sas macro filename pipe

╄→尐↘猪︶ㄣ 提交于 2019-12-01 12:22:10
问题 I am using the following Macro that uses filename pipe. But get an error saying invalid option name "dir", etc. I suspect it could be due to the quotes while defining filename and pipe. I guess it recognizes it as an option. I tried to remove the quote, removing %bquote and having just the double quote, but still keep getting the errors. I am using Windows, but will also be running it remotely on Linux. Any thoughts would be deeply appreciated. %macro setprogvar(dateval); %global date; %let

Batch script to create folders based on filenames

六眼飞鱼酱① 提交于 2019-12-01 12:16:53
I have a folder with a lot of PNG images that I want to create folders for based on their filenames. I would then want the files to be moved into their respective folders of the same name and renamed to 0000.png. Example: - abcd.png - efghi.png - jklm.png - nopqr.png - stuv.png - wxyz.png To: - abcd/0000.png - efghi/0000.png - jklm/0000.png - nopqr/0000.png - stuv/0000.png - wxyz/0000.png from the command line for /f %f in ('dir *.png /b') do md %~nf & move %f .\%~nf\0000.png if in the batch file for /f %%f in ('dir *.png /b') do md %%~nf & move %f .\%%~nf\0000.png Here is the example c:\Temp

Find file in directory with the highest number in the filename

情到浓时终转凉″ 提交于 2019-12-01 11:30:49
My question is closely related to Python identify file with largest number as part of filename I want to append files to a certain directory. The name of the files are: file1, file2......file^n. This works if i do it in one go, but when i want to add files again, and want to find the last file added (in this case the file with the highest number), it recognises 'file6' to be higher than 'file100'. How can i solve this. import glob import os latest_file = max(sorted(list_of_files, key=os.path.getctime)) print latest_file As you can see i tried looking at created time and i also tried looking at

List the filenames of attachments

a 夏天 提交于 2019-12-01 10:41:32
In this exam I get the number of "attachment file" for an email in draft data. Is there any way to get the name of this file in a msgbox or combobox or anything? Private Sub CommandButton2_Click() Dim a As Attachments Dim myitem As Folder Dim myitem1 As MailItem Set myitem = Session.GetDefaultFolder(olFolderDrafts) Dim i As Integer For i = 1 To myitem.Items.Count If myitem.Items(i) = test1 Then Set myitem1 = myitem.Items(i) Set a = myitem1.Attachments MsgBox a.Count End If Next End Sub Private Sub CommandButton2_Click() Dim a As Attachments Dim myitem As Folder Dim myitem1 As MailItem Dim j As

Reading a file name from piped command

空扰寡人 提交于 2019-12-01 10:35:06
问题 So I'm trying to get the C program to read a filename from the command line in the following format: cat (filename path) | (program name) i can get it to read the name of the input file when its entered as a command line argument, but it won't read from the concatenated argument here's the code, right now its reading the name of the file as if written after the program name on the command line. #include <stdio.h> #include <string.h> //initialize file pointer FILE *file; //initialize global

Find file in directory with the highest number in the filename

五迷三道 提交于 2019-12-01 09:27:50
问题 My question is closely related to Python identify file with largest number as part of filename I want to append files to a certain directory. The name of the files are: file1, file2......file^n. This works if i do it in one go, but when i want to add files again, and want to find the last file added (in this case the file with the highest number), it recognises 'file6' to be higher than 'file100'. How can i solve this. import glob import os latest_file = max(sorted(list_of_files, key=os.path

Remove Last Characters from my filenames in windows

断了今生、忘了曾经 提交于 2019-12-01 09:16:29
Im quite new to batch programming and i wanted to remove the last characters on my filename. 10_myfile_12345_6789.txt 11_myfile_12345_0987.txt I want to remove the last 4 digits on my filename how i could do that? I have tried this @echo off setlocal enabledelayedexpansion set X=3 set FOLDER_PATH= pushd %FOLDER_PATH% for %%f in (*) do if %%f neq %~nx0 ( set "filename=%%~nf" ren "%%f" "!filename!%%~xf" ) popd PAUSE but it removes on first and last characters, i only saw this here too, im still quite confused how this works With your recent clarification - I would do the following. @echo off

Getting file name inside Ant copy task filter

Deadly 提交于 2019-12-01 09:04:12
问题 Is it possible to get the current file name being copied inside an Ant copy task? I am trying to run a beanshell script and would like access to the current file name: <target> <mkdir dir="${project.build.directory}/generated-sources"/> <copy todir="${project.build.directory}/generated-sources" includeemptydirs="true" failonerror="true" verbose="true"> <fileset dir="${project.build.sourceDirectory}"/> <filterchain> <tokenfilter> <filetokenizer/> <scriptfilter language="beanshell" byline="true

List the filenames of attachments

怎甘沉沦 提交于 2019-12-01 08:25:44
问题 In this exam I get the number of "attachment file" for an email in draft data. Is there any way to get the name of this file in a msgbox or combobox or anything? Private Sub CommandButton2_Click() Dim a As Attachments Dim myitem As Folder Dim myitem1 As MailItem Set myitem = Session.GetDefaultFolder(olFolderDrafts) Dim i As Integer For i = 1 To myitem.Items.Count If myitem.Items(i) = test1 Then Set myitem1 = myitem.Items(i) Set a = myitem1.Attachments MsgBox a.Count End If Next End Sub 回答1: