Unzipping Files to Folders in SAS - directory

I have a complicated folder structure that is in the following format:
A --> New Jersey --> Construction --> 2020.10.27 --> Results.zip
A --> New Jersey --> Materials --> 2002.10.27 --> Results.zip
A --> Pennsylvania --> Construction --> 2020.10.27 --> Results.zip
A --> Pennsylvania --> Electrician --> 2020.10.27 --> Results.zip
As you can see, the sub-folders can have a lot of variation. Is there a way to have SAS "enter" folder 'A' and then unzip all the Zip files, but save them to the sub-folder titled '2020.10.27'? We want to make sure the unzipped csv file stays next to the zip file since all the files are names the same.
I know how to do this using a %MACRO statement with a lot of permutations, but wasn't sure if there is an easier way.
Any help would be appreciated! Thanks!

Related

docfx Shared Content between Markdown Files

In DocFX, I have a block of content which i need to put on all (or most) markdown files. Is there a way to merge or pull the contents of another md file in to the current file? Basically i am trying not to repeat myself and looking for some sort of sharing mechanism.
You can do this with file inclusion which is part of the DocFX flavored markdown (DFM).
DFM adds syntax to include other file parts into current file, the
included file will also be considered as in DFM syntax.

Missing index.html and folders structure?

After using bookdown::render_book("index.Rmd", "bookdown::gitbook") in RStudio/Windows the index file is not being generated. As the first chapter is #preface (in "index.rmd"), the file being generated is preface.html. The consequence is that it is not working in GitHub. Am I missing something?
How should be the settings in yaml files in order to keep the .rmd (source files of the book) in a subfolder of my R projects and generate the book in another folder? I am trying to have the bookdowm integrated in my research folder structure.
Thanks for this amazing package!!!
For the first question, my problem is that I had written two chapters in the index file. After removing the "# About the author" part, the index.html file came back.

ess - how to make file templates (boiler plate texts)

I've been using r-autoyas 'as-is' from what I got after installation. How do I customize it or install any other plugins that let me have templates for R documents (i.e. .R, .Rmd) whenever I create a new file?
For example, I want to put some boiler plate text:
Copyright info
Author
Date
File sections
The 'File sections' are different sections marker texts. For example:
## Library Import
## Functions
## Main Code
Maybe these can all be done with yas-snippets, but I don't know how to create custom snippet yet.

how to make language file with poedit

I'm looking to make first language pack of my theme (make not translate!) and the codes that I used in my theme is like this:
<?php echo _e('By', 'movies'); ?>
So my code variable for translate is: movies
and when I try to make the first translate .po file, will be make but will not load any item and says:
Source codes are not available.
The source codes that I used are: __ and _e
Source path is like this:
C:\Program Files (x86)\Ampps\www\tester\wp-content\themes\2015
movies\language
Which part of my job has problem?
Sorry guys I found the answer! My mistake was in source path part I suppose to write it like this:
C:\Program Files (x86)\Ampps\www\tester\wp-content\themes\2015 movies\
not until translation files folder.

slidify lectureSite: workflow and customizations

I am getting started with http://slidify.github.io/lectureSite/. I like the idea and the template very much. However, being new to this, I am struggling with customization.
Let me first explain what this 'lectureSite' architecture offers. The main code is based on rmarkdown and slidify and the customizations of the layout are mainly controlled in css files. The 'lectureSite' consists of an html webpage that serves as a contents page and starting point to access different slides ('lectures'), much of it created automagically. It looks as great as it sounds!
Each lecture is stored in a separate directory with its own 'assets' directory. So in a course made of 10 lectures, one has 10 directories, each with its own css and js. However, to achieve a common style for the whole course, one would like most of the customizations to be shared among all the lectures. My main problem is how to deal with this.
Question: How should I deal with the css customizations that I would like to share among all the lectures?
I have been successful in customizing each lecture by inserting the css code into each rmarkdown file between <style> and </style> tags, but now I would like to take the customizations to a place where they may be shared. I expected that by including a slidify.css file inside assets/css the styles would be picked up, but they are not: could I be doing something wrong or was my expectation incorrect to begin with? And besides, there are so many of those assets/css directories that it would be tedious to have to copy the css into each every time it is modified. Is there a mechanism to set a single css file that would override the css inside assets/css?
I also tried to make a 'declaration' at the top of the rmarkdown file (something I saw there: http://rmarkdown.rstudio.com/html_document_format.html) with:
css : slidify.css
but that gave the following error message:
pandoc: Could not fetch slidify.css
slidify.css: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 67
Execution halted
An alternative would be to source() a text file with the customization between <style> and </style> tags. Are there any disadvantages to this approach? And btw what is the code for sourcing an external file from rmarkdown?
Consider the following structure:
assets -> put custom img/js/css/layout assets
lectures -> folder containing lectures
Lecture 01
Lecture 02
Lecture 03
libraries -> frameworks, highlighters and widgets
index.Rmd -> Rmd source for home page
site.yml -> Site related configuration
and suppose you are inside one of the Lectures index.Rmd files. I found the following seems to 'by-pass' the local assets directory to source the 'root' directory instead:
url : {lib: "../../libraries", assets: "../../assets"}
If you place your css files into "../../assets/css/custom.css", that is the 'master' assets directory at the top of the structure (at the root, to say it differently), then it will be sourced by slidify. I deleted all the other assets directories and didn't find it did any harm (all they contained to begin with was one single file ribbons.css). Not extensively tested, but it worked on Firefox and Chrome.
In this way, I can have a single customization css for all the chapters.
However, this structure appears to work only for the html5slides framework and not for io2012. For io2012 I explain here what I did (it worked for me, but I have no idea if it's the right way):
https://github.com/ramnathv/slidify/issues/409
Somewhat more involved. Hopefully future versions of slidify will make it easier. One problem with dumping style files into the root assets directory is that, with the html5slides framework, all files are sourced. So my idea of having framework-specific css files in the assets directory doesn't work, because the styles are all sourced and some overwrite one another. So keeping the custom css files in framework-specific directories is probably a better approach anyhow.
I also found the following way of sharing R customizations and knit opts (or whatever they're called)
```{r 'preamble', message = FALSE, warning = FALSE, error = FALSE, echo = FALSE, tidy = FALSE, comment = NA, cache = FALSE} # probably several redundant ones in there
require(knitr)
opts_chunk$set(echo = FALSE, cache = FALSE) # example of knit options
source('../../shared/shared.R') # here I share common R code
```

Resources