+ How it works: Upload multiple PDF files, specify how many pages (x)
+ should be combined onto a single sheet, and the app will create a merged PDF with N-up layout.
+ Default is 6 pages per sheet (2x3 grid).
+
+
+
+
+
+
diff --git a/sakura_editor_macro/escape_regex.mac b/sakura_editor_macro/escape_regex.mac
new file mode 100644
index 0000000..b790ba1
--- /dev/null
+++ b/sakura_editor_macro/escape_regex.mac
@@ -0,0 +1,5 @@
+锘//銈兗銉溿兗銉夈優銈儹銇儠銈°偆銉
+S_ReplaceAll('([\\.\\^\\$\\*\\+\\?\\(\\)\\[\\{\\\\\\|])', '\\\\$1', 22); // 銇欍伖銇︾疆鎻
+S_ReDraw(0); // 鍐嶆弿鐢
+S_ReplaceAll('\\r\\n', '\\\\r\\\\n', 22); // 銇欍伖銇︾疆鎻
+S_ReDraw(0); // 鍐嶆弿鐢
diff --git a/sakura_editor_macro/grep_blog.mac b/sakura_editor_macro/grep_blog.mac
new file mode 100644
index 0000000..6e9ea9f
--- /dev/null
+++ b/sakura_editor_macro/grep_blog.mac
@@ -0,0 +1,2 @@
+锘//銈兗銉溿兗銉夈優銈儹銇儠銈°偆銉
+S_Grep('\\d+', '*', 'C:\\Users\\Shin.SHINJI-PC2\\Documents\\Code\\blog\\hugo-source\\content', 25393, 99); // Grep
diff --git a/sakura_editor_macro/import_from_excel.mac b/sakura_editor_macro/import_from_excel.mac
new file mode 100644
index 0000000..6798ce1
--- /dev/null
+++ b/sakura_editor_macro/import_from_excel.mac
@@ -0,0 +1,7 @@
+//Keyboard macro file
+ReplaceAll('\\t', '\',\'', 6); // Replace All
+ReDraw(0); // Redraw
+ReplaceAll('^', 'insert into XXX_YYY select \'', 6); // Replace All
+ReDraw(0); // Redraw
+ReplaceAll('$', '\' from dual ;commit;', 6); // Replace All
+ReDraw(0); // Redraw
\ No newline at end of file
diff --git a/shell/encoding.sh b/shell/encoding.sh
new file mode 100644
index 0000000..b5a79ae
--- /dev/null
+++ b/shell/encoding.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+#enter input encoding here
+FROM_ENCODING="GB2312"
+#output encoding(UTF-8)
+TO_ENCODING="UTF-8"
+#convert
+CONVERT=" iconv -f $FROM_ENCODING -t $TO_ENCODING"
+#loop to convert multiple files
+for file in *.txt; do
+ $CONVERT "$file" "$file" > "../${file}"
+done
+exit 0
\ No newline at end of file
diff --git a/shell/ic.sh b/shell/ic.sh
new file mode 100644
index 0000000..730875e
--- /dev/null
+++ b/shell/ic.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+#function batch_convert() {
+ for file in *.srt
+ do
+ # iconv -f BIG-5 -t UTF-8 "$file" > "sub/_$file"
+# mv -f "$file.new" "$file"
+recode BIG-5..UTF-8 "$file"
+ done
+#}
+
+#batch_convert ~/Media/sf_share/sub
\ No newline at end of file
diff --git a/shell/subrename/mergesub.sh b/shell/subrename/mergesub.sh
new file mode 100644
index 0000000..acf3307
--- /dev/null
+++ b/shell/subrename/mergesub.sh
@@ -0,0 +1,60 @@
+if [ $# -ne 2 ]; then
+ echo "--- need argument ---";
+ exit 1;
+fi
+if [[ $1 == *"\\"* ]]; then
+ echo "--- path cannot contains \\ ---";
+ exit 1;
+fi
+if [[ $2 == *"\\"* ]]; then
+ echo "--- path cannot contains \\ ---";
+ exit 1;
+fi
+
+if [[ ! -d $1 || ! -d $2 ]]; then
+ echo "--- path does not exist\\ ---";
+ exit 1;
+fi
+
+IFS=$'\n'
+
+root=`realpath ${0%/*}`
+log=$root/`date '+%Y_%m_%d_%H_%M_%S'`.log
+
+cd $1;
+
+origin=(`ls`);
+
+echo ${origin[*]}>`expr $log`
+echo "---">>`expr $log`
+echo "origin files:"
+for i in ${origin[*]};do
+ echo " "$i
+done
+echo
+
+echo "origin length is "${#origin[*]}
+
+cd ..
+cd $2;
+sub=(`ls`);
+echo ${sub[*]}>>`expr $log`
+echo "sub files:"
+for i in ${sub[*]}; do
+ echo " "$i;
+done
+echo "sub length is "${#sub[*]}锛
+echo
+
+if [ ${#origin[*]} != ${#sub[*]} ]; then
+ echo "---- file num do not equal ---";
+ exit 1;
+fi
+
+for((i=0;i<`expr ${#sub[*]}`;i++));do
+ echo ${sub[`expr $i`]};
+ echo ${origin[`expr $i`]%.*}
+ cat $1/"${origin[`expr $i`]}" >> "${sub[`expr $i`]}"
+ #mv ${sub[`expr $i`]} ${origin[`expr $i`]%.*}.srt
+done
+echo result $?;
\ No newline at end of file
diff --git a/shell/subrename/presubrename.sh b/shell/subrename/presubrename.sh
index 27b8921..530bdc2 100644
--- a/shell/subrename/presubrename.sh
+++ b/shell/subrename/presubrename.sh
@@ -23,7 +23,7 @@ log=$root/`date '+%Y_%m_%d_%H_%M_%S'`.log
cd $1;
-origin=(*);
+origin=(`ls`);
echo ${origin[*]}>`expr $log`
echo "---">>`expr $log`
@@ -33,17 +33,17 @@ for i in ${origin[*]};do
done
echo
-echo "origin length is "${#origin[*]}
+echo "origin length is `ls | wc -l`"
cd ..
cd $2;
-sub=(*);
+sub=(`ls`);
echo ${sub[*]}>>`expr $log`
echo "sub files:"
for i in ${sub[*]}; do
echo " "$i;
done
-echo "sub length is "${#sub[*]}锛
+echo "sub length is `ls | wc -l`"
echo
if [ ${#origin[*]} != ${#sub[*]} ]; then
diff --git a/shell/subrename/rename.sh b/shell/subrename/rename.sh
new file mode 100644
index 0000000..22c80a6
--- /dev/null
+++ b/shell/subrename/rename.sh
@@ -0,0 +1,8 @@
+mv *S01E01* The.Staircase.2022.S01E01.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass
+mv *S01E02* The.Staircase.2022.S01E02.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass
+mv *S01E03* The.Staircase.2022.S01E03.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass
+mv *S01E04* The.Staircase.2022.S01E04.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass
+mv *S01E05* The.Staircase.2022.S01E05.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass
+mv *S01E06* The.Staircase.2022.S01E06.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass
+mv *S01E07* The.Staircase.2022.S01E07.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass
+mv *S01E08* The.Staircase.2022.S01E08.AMZN.WEB-DL.DDP2.0.H.264-BTW.ass
\ No newline at end of file
diff --git a/shell/subrename/subrename.sh b/shell/subrename/subrename.sh
index ddaf066..023794a 100644
--- a/shell/subrename/subrename.sh
+++ b/shell/subrename/subrename.sh
@@ -23,7 +23,7 @@ log=$root/`date '+%Y_%m_%d_%H_%M_%S'`.log
cd $1;
-origin=(*);
+origin=(`ls`);
echo ${origin[*]}>`expr $log`
echo "---">>`expr $log`
@@ -33,17 +33,17 @@ for i in ${origin[*]};do
done
echo
-echo "origin length is "${#origin[*]}
+echo "origin length is `ls | wc -l`"
cd ..
cd $2;
-sub=(*);
+sub=(`ls`);
echo ${sub[*]}>>`expr $log`
echo "sub files:"
for i in ${sub[*]}; do
echo " "$i;
done
-echo "sub length is "${#sub[*]}锛
+echo "sub length is `ls | wc -l`"
echo
if [ ${#origin[*]} != ${#sub[*]} ]; then
diff --git a/shell/subrename/zipmanga.sh b/shell/subrename/zipmanga.sh
new file mode 100644
index 0000000..54d1c24
--- /dev/null
+++ b/shell/subrename/zipmanga.sh
@@ -0,0 +1 @@
+for dir in */; do ( cd "$dir" && zip -r ../"${dir%/}".zip . ) done