Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Decoding encoded SVGB files into normal SVG using batch


  • Please log in to reply

#1
PatrickMc

PatrickMc

    New Member

  • Member
  • Pip
  • 3 posts
Somebody asked this question:

I downloaded a program svgb.exe that decodes encoded SVGB files into normal SVG. It is a command line tool. The syntax is

svgb.exe "Entry01.svg" "Entry01.svg"

I have thousands of files in \folder1 that need to be decoded and placed into \folder2. Is there a way to automate this ?


Yes.

Here is the script. It is in biterscripting. ( http://www.biterscri...om/install.html for installation instructions. I downloaded it for free.)

Save this script as C:\Scripts\svg.txt. Start biterscripting. Call the script as

script "svg.txt"

That would decode all of your thousands of files. Here is the script.

# Collect a list of input .svg files from \folder1.
var string inputlist; lf -n "*.svg" "\folder1" > $inputlist
# Chage current directory to output directory.
cd "\folder2"

# Process input files from list one by one.
while ($inputlist <> "")
do
	# Get the next input file.
	var string input; lex "1" $inputlist > $input

	# Input file name is in full path, extract just the file name into $output.
	var string output; stex "^/^l[" $input > $output

	# Decode file using svgb.exe.
	svgb.exe ("\""+$input+"\"") ("\""+$output+"\"")
	# We are wrapping $input and $output in case file names/paths contain spaces.
done

  • 0

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP