How to change name of import in importTextFile.php - directory

I am trying to import a large group of text files into mediawiki using the importTextFile.php program. My files are stored in a directory as such (names changed to protect original file names)
Animals
- Kangaroo.txt
- Peacock.txt
- People^humans.txt
I want to import the directory using the follow names
Kangaroo, Peacock, People/humans
I want to replace "^" with "/" when naming these elements which I can't do while they are in a directory or else windows thinks that it is a "/" creating a new directory

Related

File Name generated by passed variable getting special character appended

I'm creating an archive filename by combining output folder and output file name which are both passed variables.
Example tar -czf $output_folder/$output_file.tar.gz.
However the generated file is getting an unicode character U+25AA appended, so it looks like output_fileU+25AA.tar.gz. What could be causing this? - I'm testing it on a Windows machine

How to extract folder's name (a series number ID) in R?

I have got a large number of folders containing CSV and htm files. Each folder has an unique folder name as ID. I am wondering would it be possible extract folder names?
For any directory path string, you can use:
fullpath = getwd()
directoryname = basename(fullpath)
For a whole range of directories:
manydirectories = list.dirs()
directorynames = basename(manydirectories)
You only need to omit the "." in directorynames to then get the folder names within that directory.

stylus/css import: select all but ones with a suffix

A .styl file imports all files from selected folders. How to correctly write a rule (or, what is the best way) to import all files except ones that contain the -ie suffix (i.e. bar-ie.style)?
The following code is not wroking:
import(['../modules/*', '!../modules/*-ie.styl'])
Or, is there a way to write it the regexp way, similar to:
import('../modules/+(*|!*-ie.*)')
If what you are asking for is a regex to match files that don't contain a -ie.style then this should do the trick:
^(.(?!-ie\.style))+$

How can I search for a particular string in a folder full of files and import it?

I have a folder full of files with filenames such as these.
[1] "ts.01382800.crest.csv" "ts.01383500.crest.csv" "ts.01384500.crest.csv" "ts.01386000.crest.csv"
[5] "ts.01387000.crest.csv" "ts.01387400.crest.csv" "ts.01387420.crest.csv" "ts.01387450.crest.csv"
[9] "ts.01387500.crest.csv" "ts.01387908.crest.csv"
I need to do one operation again and again. Basically search for a particular string (Say, 1382800), find the filename with the match and import it. Please note, the name may not be exact match as the preceding zero may not exist sometimes.
Currently, I am importing a list of the files in the folder using list.files, using grep on that list to find a filename, then re-constructing the file path and importing it. There must be an easier way to do it.
This code filter all the data contains 1382800
ls <- list.files(path='~/',pattern="1382800")

i want to create a file with the system date in another directory and copy some data into it. Unix

I want to create a file with system date in another directory and copy data difference of two files into it.
NOW=$(date +"%H_%D")
file="log_$NOW.txt"
diff tmp1.txt tmp2.txt > $temp/log_$NOW.txt
i am using above code. But file is not getting generated. Apart from it if i create a file with simple name i.e without using $NOW the file is getting generated. Please help me.
The format string to date produces something like 16_12/03/13. This contains directory separators so the filename becomes invalid. Instead use dots to separate the date:
NOW=$(date +"%H_%m.%d.%y")
which should produce strings like 16_12.03.13

Resources