batch-processing

Applescript to (if/then) determine file type and choose correct program to open and print file (within batch sequence)

岁酱吖の 提交于 2019-12-24 06:38:23
问题 I have culled together an applescript with great help from @chuck and other board posts to effectively batch print a list of files exported from filemaker containers to a folder called "print" on my desktop. The problem I'm running into now is some of those container exports are not PDF (its a mix of Jpg, PNG, Tif and PDF) and will not open using acrobat (using preview for the PDF or any other PDF viewer is out of the question for a myriad of reasons)... This problem is effectively shutting

OSX perl to batch write filename as first line in txt file in UTF-16LE

那年仲夏 提交于 2019-12-24 03:24:07
问题 I found a really useful bit of perl here that writes the filename of a text file to the first line of the file. I am running this from terminal in OS X Yosemite: perl -i -pe 'BEGIN{undef $/;} s/^/\nFilename:$ARGV\n/' `find . -name '*.TXT'` With some modification I thought it had solved my specific problem however the files I'm picking up are UTF-16LE and I've since discovered this command is writing in UTF-8 and making a real mess of the output (text is visibly correct but is not recognised

Batch saving EKEvents to Google calendar causing loss of random events

♀尐吖头ヾ 提交于 2019-12-24 03:22:33
问题 I have a large set of activities that I want to batch save to the calendar. Which calendar is selected by the user. They have the option to export to iCloud calendar or Google calendar. When exporting to iCloud calendar everything runs smoothly. No problems. However, when exporting to Google calendar I am encountering som weird issues. The number of events to be saved is somewhere around 60-90 events. I use the function provided below to export the calendar events in the background. The

Using JDBC PreparedStatement.addBatch in functional Scala code

强颜欢笑 提交于 2019-12-23 21:51:37
问题 I need to read several million rows from one database and write them to another. I would like to use PreparedStatement.addBatch to do the writes in large batches (maybe 1000 rows). I do not need them to be in a transaction. I am writing my code in Scala 2.9.2. One way to do this is as follows: val sourceResultSet = ... val targetStatement = targetConnection.prepareStatement(...) var rowCount = 0 while (sourceResultSet.next()) { // Read values from sourceResultSet and write them to

R distinguishing between batch and interactive mode

浪尽此生 提交于 2019-12-23 18:52:52
问题 I would like to have a condition in my code which allows me to distinguish if the code is running in Batch or interactive mode (via console). It would be something like this: if (interactive mode) {do this} else if (Batch mode) {do that} Is there a way to achieve this? Thanks for your help. 回答1: You can use the interactive function. For example, executing this from a terminal Rscript -e 'cat(interactive())' returned FALSE for me, while executing interactive() from my RStudio session returned

R CMD BATCH - output in terminal

人走茶凉 提交于 2019-12-23 10:55:08
问题 Just learning R and I thought it would be great to use it in batch mode in the unix terminal instead of writing in the R terminal. So I decided to write test.r x <- 2 print(x) then in terminal I did R CMD BATCH test.r it runs, But outputs a test.r.Rout file. I can get it to output to say a text file by running R CMD BATCH test.r out.txt. Question is, is it possible to print the output to the terminal? 回答1: Sebastian-C posted: Rscript test.r This worked in the terminal and produced the desired

Fetching large number of records from MySQL through Java

吃可爱长大的小学妹 提交于 2019-12-23 01:34:49
问题 There is a MySQL table, Users on a Server. It has 28 rows and 1 million records (It may increase as well). I want to fetch all rows from this table, do some manipulation on them and then want to add them to MongoDB. I know that it will take lots of time to retrieve these records through simple 'Select * from Users' operation. I have been doing this in Java, JDBC. So, the options I got from my research is: Option 1. Do batch processing : My plan was to get the total number of rows from the

Why number of objects being flushed should be equal to hibernate.jdbc.batch_size?

前提是你 提交于 2019-12-22 12:39:31
问题 As hibernate documentation says when doing batch inserts/updates the session should be flushed and cleared when number of objects equal to the jdbc batch size ( hibernate.jdbc.batch_size ). My problem is why that number should be equal to the hibernate.jdbc.batch_size . Is there a performance tip? Edit: For an example think that I have set the hibernate.jdbc.batch_size to 30 in my hibernate.cfg file. Then As the doc says, the session should be flushed when the object count equals to 30. Why

Skip header, body and footer lines from file on Spring Batch

强颜欢笑 提交于 2019-12-22 10:57:49
问题 I have this specifically file: H;COD;CREATION_DATE;TOT_POR;TYPE H;001;2013-10-30;20;R D;DETAIL_VALUE;PROP_VALUE D;003;3030 D;002;3031 D;005;3032 T;NUM_FOL;TOT T;1;503.45 As you can see, it has header/body/footer lines. I'm looking for a ItemReader that skip these lines. I've done this ItemReader below who identify those lines, using PatternMatchingCompositeLineMapper . <bean id="fileReader" class="org.springframework.batch.item.file.FlatFileItemReader"> <property name="resource" ref=

How to rename n files with ANT? (Batch Job)

旧街凉风 提交于 2019-12-22 01:38:11
问题 How can I rename 1..n file with ANT? I would like to rename any files with xxxx.default.properties to xxxx.local.properties . Thank you. 回答1: Using the move task you could do something like this: <move todir="my/src/dir" includeemptydirs="false"> <fileset dir="my/src/dir"/> <mapper type="glob" from="*.default.properties" to="*.local.properties"/> </move> Give it a try and let us know. 回答2: Use the move-task. There is also an example how to rename a set of files (last examples). 来源: https:/