Running a batch file on Kid3 ID3 MP3 tagger - batch-file

I finally gave up after 120 hours of not finding a .NET or javascript/jquery plugin that can read and write to a COMPRESSED custom user frame (TXXX) in ID3v2 MP3 audio file.
UltraID3Lib: cannot read or write COMPRESSED Frames (last updated 2009, author Mitchell S. Honnert fell off face of the earth).
ID3Lib-sharp: cannot read or write COMPRESSED Frames (last updated 2012)
JavaScript-ID3-Reader: can return bytes but it's mostly the wrong bytes. Cannot write anything.
I cannot use the multitudes of Node.js or PHP scripts for my project so they are out of the question.
The only code I found that can read and write compress frames is Kid3.
http://sourceforge.net/projects/kid3/
However, it is written in C (I don't know that) and uses third party frameworks since it was not built in windows. The Command program required 13MB of support dlls, QMs, and whatevers.
I have no choice at his point but to try and use it's separate command program kid3-cli.exe
So here's my question:
Here is the way to read a TXXX frame using the program at the command prompt.
"71F3-15-FOO58A77" is the name of the TXXX frame and the "2" gets the text value it holds:
cd "C:\mp3folder"
select "test.mp3"
get "71F3-15-FOO58A77" "2"
export "clipboard" "CSV unquoted" "2"
QUESTION: HOW DO I use a Batch file to run these commands?
According to kid3 documents. It shows using -c as grouped commands. Windows cmd (or the program) on windows does know what -c is.
Example: I double click the batch file and it should:
start the program
sent the program (not cmd) the above 4 lines
each must be executed separately.
Sounds simple, but I can't get it to even execute one of the programs code after starting.
Any ideas? and and can someone write a ID3 tag program that can read and write COMPRESSED TXXX tags without using node.js, PHP or a server in Windows.
I will buy them a beer because I'm really a (cheap) designer by trade and a pert-time programmer only when I have too.
Here is a zip file of a COMPRESSED TXXX Frame in test.mp3 to test:
[http://robbiestewart.ca/test.zip][1]
Download Kid3 and use its windows GUI (kid3.exe) to view the custom user frame (TXXX).
Run the included kid3-cli.exe to do the same at the command prompt.
Try to do the same in a batch file.

According to the help file, you should be able to use the command
kid3-cli -c 'cd "C:\mp3folder"' -c 'select "test.mp3"' -c 'get "71F3-15-F0058A77" "2"' -c 'export "clipboard" "CSV unquoted" "2"'
I ran it on the file you provided and seven tabs followed by 0:00.00 were put on my clipboard, but the value of the TXXX field indicated by the GUI was output to my command prompt.

Related

FOR /f in DOS alternative

As it appears there is no version of DOS (6.22 to WinME "DOS") or FreeDOS that allows you to take part of a text file and make it a variable, I'm going to just keep collecting the data I get in DOS mode into one very large file but I can't think of a way to get each asset and UUID and add them together in a third file... Here is what I get at the moment:
SMBIOS.TXT
~~~~~~~(usually 27 lines of stuff I don't need)~~~~~~~
Asset Number: ABC12345
~~~~~~~(usually 37 lines of stuff I don't need)~~~~~~~
UUID: ABCDEF12345678901234567890
~~~~~~~(usually 4 lines of stuff I don't need, complicated by a # symbol in there too)~~~~~~~
^Repeated many times
I need to add both the Asset Number and the UUID together in a CSV format so I was previously hoping (before I exhausted all attempts at doing for /F in DOS) just echoing the two variables I was creating as follows:
ECHO !Asset!,!UUID!>>Results.CSV
Which again works in Windows command prompt just not DOS, the script I'm using however only gets the first variable of each so I need to do them in order and keep repeating through the file in the manner?
Alternatively is there any other way I could use DOS to get the info I need out of the two text files on the fly? It's all running from a USB stick so I don't have any size constraints at least.
Aaron
You may be able to get it done with the DOS command line text stream editor EDLIN.
I am assuming this has to be done in DOS and Windows is not an option.
PDGREPPE is an MS DOS command line GREP search and replace utility.
Maybe you can find a DOS Text Editor with Macros
Lotus 123?
DBase?
Write an app in DOS BASIC.

Arelle locate ratio extraction command that i cannot understand to find in docs(~2pages)

The basic command while we are working with Command Line Operation in Arelle is:
python arelleCmdLine.py arguments
provided we go with the cmd to the folder that arelle is installed.
I have devoted huge resources but i cannot find if there is a command in the Documentation (about ~2 pages) that can output ratios (e.g. Current Ratio) or metrics (e.g. Revenue) instead of having to download all the data in Columns and filter the data. I must admit that i cannot understand some commands in the documentation.
What i am doing to download data is:
python arelleCmdLine.py -f http://www.sec.gov/Archives/edgar/data/1009672/000119312514065056/crr-20131231.xml -v --facts D:\Save_in_File.html --factListCols "Label Name contextRef unitRef Dec Prec Lang Value EntityScheme EntityIdentifier Period Dimensions"
-f is the command that pulls data and after that is a location with data in the web
-v is the command to validate the data that are pulled
--facts Saves the data in an HTML file in a designated directory
factListCols is the Columns i choose to have (i take all the available columns in the upper command).
There is an absolute zero on tutorials.
Arelle only runs on Python 3 and can be downloaded without creating a hassle only by following these quick and simple steps.

Find multiple files from the command line

Description:
I am searching a very large server for files that is on a different server. right now I open command prompt and type
DIR [FILE NAME] /S/4
This returns the server location of the file with some other stuff that is not really needed.
Question:
I have a lot of files to search and one by one input into the above command could take forever. Is there a way I could input all of the names of all the files and only search once and the search results would only need to show file name and location?
First, I hope you don't mean DOS, but rather Windows cmd or batch.
You can certainly write a script that will run your DIR command once per file being sought.
But what you most likely want instead is to search once and print the path of each file found. For this you can use PowerShell's FindChildItem or the improved one posted here: http://windows-powershell-scripts.blogspot.in/2009/08/unix-linux-find-equivalent-in.html
It will be something like:
Find-ChildItem -Name "firstfile.txt|secondfile.txt|..."
Another approach is to install msys or cygwin or another Linux tools environment for Windows and use the Linux find command.

Shell Script to typeset Lilypond files with Textwrangler

I need a shell script which will allow me to typeset Lilypond files from TextWrangler (A Mac App).
So far I have come up with this:
#!/bin/sh
/Applications/LilyPond.app/Contents/Resources/bin/lilypond -o $1
which, of course, doesn't work. (That's why I'm at Stack Overflow.)
When I run that script from the shebang menu in TextWrangler, I get this output:
/Applications/LilyPond.app/Contents/Resources/bin/lilypond: option faultpaper,
--output'' requires an argument
What gives?
I'm running Snow Leopard, TextWrangler, and Lilypond.
Help appreciated.
EDIT: Found a way to get the document path in a Unix Script launched by TextWrangler, so I've rewritten this.
There are multiple ways to work with scripts in TextWrangler through the #! menu, and I'm not sure which one you're trying to use. It looks, though, like you're trying to create a Unix Script to convert your LilyPond document.
As your error hints, Unix Scripts unfortunately aren't given any arguments at all, so $1 will be empty. However, it turns out that recent versions of BBEdit/TextWrangler do set some environment variables before running your script (see BBEdit 9.3 Release Notes and scroll down to Changes). In particular, you can use the following environment variable:
BB_DOC_PATH path of the document (not set if doc is unsaved)
So, save this script to ~/Library/Application Support/TextWrangler/Unix Support/Unix Scripts and you should be good to go.
Other ways you might be trying to do this that don't work well:
Using a Unix Filter: to do this you would have to select all of your LilyPond code in the document, and it would be saved into a temporary file, which is passed as an argument to your script. OK, so that gets you an input filename, at the cost of some hassle. But then the output of that script (i.e. the LiiyPond compiler output) by default replaces whatever you just selected, which is probably not what you want. Wrong tool for the job.
Using #! → Run on a LilyPond file: This involves putting a #! line at the top of your file and having TextWrangler attempt to execute your file as a script, using the #! as a guide to selecting the script interpreter. Unfortunately, the #! line only works with certain scripting languages, and LilyPond (not quite a scripting language) isn't one of them. This is what Peter Hilton is trying to do, and as he notes, you will get LilyPond syntax errors if you try to add a #! line to the top of a LilyPond file. (If you're curious, there is technically a way to get #! → Run to work, which is to embed your LilyPond code inside an executable shell or perl script, using here-document syntax. But this is a gross hack that will quickly become unwieldly.)
There are a few limitations to the script linked above:
It doesn't check to see whether you saved your document before running LilyPond. It would be nice to have TextWrangler automatically save before running LilyPond.
It can't take snippets of text or unsaved documents as input, only saved documents.
You can make more sophisticated solutions that would address these by turning to AppleScript. Two ways of doing this:
Create a script that's specific to TextWrangler and drop it in ~/Library/Application Support/TextWrangler/Scripts. It then shows up in the AppleScript menu (the weird scrolly S), or you can get at it by bringing up Window → Palettes → Scripts. I believe two folks out there have gone down this path and shared their results:
Henk van Voorthuijsen (Lilypond.applescript extracted from MacOS 10.5 Applescript for TextWrangler thread on lilypond-devel, 21-Jul-2008)
Dr Nicola Vitacolonna (LilyPond in TextWrangler – uses TeXShop).
Create a Mac OS Service, which would potentially be a method that would be reusable across just about any text editor. This was how we used to compile Common Music files way back in the NeXT days, so I can testify to its elegance. I don't have a good up-to-date example of this, unfortunately.
Good question. It actually runs Lilypond on my system if you do this:
#!/Applications/LilyPond.app/Contents/Resources/bin/lilypond -o $1
… but fails because # is not a line-comment character so Lilypond tries to parse the line.
Surrounding it with a block comment fails because TextWrangler cannot find the ‘shebang’ line.
%{
#!/Applications/LilyPond.app/Contents/Resources/bin/lilypond -o $1
%}
An alternative is to use Smultron 3, which lets you define commands that you can run with a keyboard shortcut.

How do we write a program in Command line development environment?

I have been writing my code in IDE,I just read that there also existed a Command Line Development Environment in which the code is written in DOS.I googled but found no results on how to use the command line development environment.My OS is Windows XP.I would be very thankful for your help me write the hello world program in DOS and also explain how to run it.
You simply use whatever text editor you like to create the C sourse file(s) then invoke the compiler command line(s) to compile and link the program (typically, an IDE is doing exactly that, but in a behind-the-scene manner). How the command line is invoked depends on the exact toolchain you're using.
You might also need to set up an environment for you particular compiler toolchain (the right paths and various other env variables might need set up).
For Visual C++ the environment might be set up using a batch file installed by Visual Studio:
vcvarsall x86
Invoking the compiler could be as simple as:
cl helloworld.c
or for C++ (for some reason it issues a non-fatal warning if you don't give it an option configuring details about how it should implement exceptions):
cl /EHsc helloworld.cpp
The particulars are very dependent on the compiler you're using - you should read the docs for that compiler.
Also, the options you use depend on your particular situation and needs. Scripts/batch files and/or makefile can help you manage the complexity of the options you might need to use.
DOS is not dead.... yet!
fahad
There are a number of methods by which you can enter code in DOS (see EDIT further on down).
(1) You can send keystrokes directly to a file
You do this by redirecting output to CON (the console) to a file. The only oddity of this method is that you end the 'session' by entering a CTRL-Z when you are finished.
It's basic, but this is how it goes.
Firstly, suppose you want to display "Hello World" on the screen, a simple batch file containing the following two lines is all that is required:
#echo off
echo Hello World
The '#echo off' is commonly found at the start of all batch files. It simply instructs the command interpretter NOT to display each command as it is being executed (or parsed).
One more thing before we start. Throughout this answer, I will assume your program is named 'helloworld.bat'.
Enter the following lines one after the other pressing the ENTER key at the end of each line:
copy con helloworld.bat
#echo off
echo Hello World
^Z
The '^Z' is displayed when you press the CTRL-Z key combination (don't forget to press the ENTER key as well).
When you press the ENTER key after CTRL-Z, DOS displays the familiar '1 File(s) copied' messege.
You can now execute the batch file program by simply entering the program's name like this:
helloworld
And DOS will display the following:
Hello World
It can't get any more basic than that.
(2) You can use DOS' EDIT program
This is a DOS based IDE retained from around the mid-90's. Simply enter the following command:
edit
And EDIT will open in the same DOS window. When you close EDIT, you are returned back to DOS again.
EDIT also works with your mouse.
Once EDIT opens, enter the following two lines of code:
#echo off
echo Hello World
Then, click on [File], [Save], type: 'helloworld.bat' in the "File Name" input field, use your mouse to change directories in the "Directories:" pane if you want to, then click [OK]. To return to DOS, click [File], [Exit].
EDIT version 4.5 (I think) was context-sensitive and displayed code using different colours to seperate key word, different data type, symbols etc.
(3) Use Windows' built-in Notepad
This is simple. At the command prompt, enter the following command:
notepad
And Notepad will fire up. It's a simple text editor and does the job when entering small programs.
(4) Use Notepad++. It's FREE!!
Notepad++ is the programmer's choice. It's free, full of useful features and customisable. Find it on the net by searching for "notepad++".
From your comment, "Just some knowledge so I can say that I know one way to do programming without IDE" I would say learn to write simple batch files. They can be run from Explorer but they exist as a holdover from the DOS days.
Start a command prompt window (Start->Run->'cmd'), this will open a window and show a prompt, most likely "c:\" or some other path.
Type the following command (followed by )
echo "Hello World"
You should see:
"Hello World"
c:\
Now, using whatever editor you'd like, create a text file with that command as the only line. Name the file "hello.bat". When you are at the command prompt you can execute the batch file like so:
c:\hello.bat
"Hello World"
c:\
You have now programmed using the DOS command line. For more commands and such, start with the help system.
c:\help
Which will display all the available commands for your batch file.
Microsoft has an online reference here.
DOS is dead for all practical purposes. Under Windows your options boil down to the following:
Use an IDE. Visual Studio is one example, Qt another. You can write programs for the commandline with an IDE.
Use a proper text editor, build tool and other helper tools. You might use gvim for editing code, make for building your project and git for version control. You might as well use the GNU coreutils for other helpers, or maybe even the entire cygwin package.
Bro, use gcc compiler for which write ur code in any text editor then compile ur code in windows shell or u can say command line environment.
Look!
Prompt:/> gcc source_file_name.c
This command compiles ur code,
If there is any error, u will get dispalyed with line numbers,
now, every program creates its exe file by the name a.exe by default.
To, get the output of ur program,
Prompt:/> a.exe
O/P
Hello World!
To change the name of the exe file there is also a command..

Resources