Question:
Scripting Programming Language question?
2013-08-25 12:14:06 UTC
I have been thinking about learning a scripting language, I've already decided I would be using javascript which will be good for web things in web applications but what would be good for a scripting language that could control files on a computer easily in simply? So for instance let's say I have a thousand files and I need to rename them all I don't want to ride along program out that to do something so simply in quickly if done with scripting I'm not even sure if that's true that scripting would make a quicker or easier I do not have very much experience with it but if someone has experience with it I would be very interested to know a good scripting language I should focus on. Preferrably one that would be good with real world applications I am NOT interested in a scripting language is for teaching people the simple way to program already have a strong foundation with programming I don't know if this makes sense I'm just rambling now but if you can understand what I'm getting at I'd appreciate to hear from you
Three answers:
James C
2013-08-25 12:46:21 UTC
File manipulation such as moving, deleting, copying, and renaming can be done using Visual Basic Script. It is a fairly easy script to learn and you will find many good instructional sites, search for "VBS and scripting."
?
2013-08-25 20:38:29 UTC
it depends on which OS you are using. If you are using a UNIX type OS, the terminal is always driven by a shell that supports a very powerful scripting language. then it just depends which shell you are using, as there are dozen of them available. so in unix parlance, you'd be doing "shell scripting" - writing an executable text file that executes the command contained therein. the default shell is /bin/sh (bourne shell) -- it's the original, and has a somwhat cryptic syntax to content with. if you're used to C then you might try /bin/csh or /bin/tcsh -- the C shell and the T shell. their syntax is a blend between C and bourne shell and may be a little more intuititve for a C programmer.



the bottom line though is that for file manipulation, the shell scripts are great -- when you can address all files in an entire directory with just a simple "for i in ()", it's great. however, depending on the level of sophistication you require in what to do with that file, you may need to couple it with the OS built-in file filters (sed, grep, awk) or augment the capabilities with a more powerful scripting language (perl, python) and in the worst case, bust out the no kidding programming approach (C, Java, etc.)



with UNIX, you've got a really great toolbox full of tools, so it's more important to be familiar with the tools you have available so as to avoid the "everything looks like a nail when all you have is a hammer" issue found in other OSes. that said, the shell script might not be what you're looking for -- and it's not a good idea to waste too much time with them -- just learn enough to get your job done and keep the script around to remind you how to do things like it in the future.



and that brings us to windows. while windows has a command prompt and can support batch file processing, i wouldn't waste my time with that approach. in that os context, you're better off starting with perl or python -- but at that point, you're so close to using a full programming language that it's somewhat of a toss up.



the beauty of the situation is that most users stick to the GUI point-n-click; so they never look under the hood and harness the power of the command shells/processes at their disposal if they chose to look for it.
?
2013-08-25 19:28:11 UTC
NO scripting language can make that kind of program. You would need to learn a real programming language like C or a derivative. And Javascipt is no good whatsoever on its' own. But don't get carried away. You need to be able to think for yourself, type accurately, use correct language and syntax and prepare logically for programming, and from the way you put this question it is obvious you can do none of that.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...