Here is how it would work, if you are interested in considering use of sed.
The sed command makes a substitution, like "s:Old:New:". For the "Old" part, It saves everything at the beginning of the line before the extensions. For the "New" part it says RENAME, and then the original file name (&) and then the new file name using the part if saved (\1).
Maybe someone else knows how to do this just with BATCH programming.
Last edited by hanson44; 04-27-2013 at 08:05 PM..
Reason: editor puts in happy face for :old
in Bash i'm trying to rename directories full of files. the file name pretty much stays the same except for the numerical prefix which will be the same for all files. so, i want to rename these...
45-body.php
45-header.php
45-footer.php
etc.
to...
46-body.php
46-header.php... (2 Replies)
Hello. I'm a complete newbie to C programming. I have a C program that wasn't written by me where I need to write some wrappers around it to automate and make it easier for a client to use. The problem is that the program accepts standard input to control the program... I'm hoping to find a simple... (6 Replies)
Hi.
I've posted a couple of questions on my little project before, and it's been helpful, but things just keep changing on my end.
Allow me to explain.
I'm getting hundreds of .txt files, each containing the results of a database search from a newspaper. EAch file contains the news stories... (10 Replies)
Hi Guys,
I've been learning UNIX for the past couple of days and I came across this exercise, I can't get my head around it, so I would be ever so grateful if I could receive some sort of help or direction with this.
Create a file with x amount of lines in it, the content of your choice. ... (3 Replies)
Hi guys,
could someone tell me how i could create a label like this:
mybox01, mybox04, mybox12, mybox10 when i have the values "mybox1", "mybox4","mybox12","mybox10" as a prefix and a number. If the number is below 10 then add a zero before the number?
A one liner?
A long approach is to... (2 Replies)
Hi
Having many filenames in a folder containing the string "-DATE" (e.g. : Nbr_Name-DATE_2011.txt). I would like to remove the "-DATE" in each filename to get just: Nbr_Name_2011.txt . Know its easy but somehow it wont work. Tried it like that:
for i in `ls *-DATE*`; do mv "$i"... (10 Replies)
Hi, guys, I'm a new comer here. I'm studying Unix Shell and I met a problem confusing me a lot. Here it is :
script 1:
#!/bin/sh
# scriptname : do_increment
increment(){
sum=`expr $1 + 1`
return $sum # Return the value of sum to the script.
}
echo -n "The sum is "
increment $1 # Call... (2 Replies)
Cheers!
In /etc/syslog.conf, if an error type is not specified, is it logged anywhere (most preferable is it logged to /var/log/messages) or not?
To be more precise I am interested in error and critical level messages. At default these errors are not specified in syslog.conf, and I need to... (6 Replies)
Discussion started by: dr1zzt3r
6 Replies
LEARN ABOUT CENTOS
kateenc
KATEENC(1) libkate KATEENC(1)NAME
kateenc - create Kate streams from text input
SYNOPSIS
kateenc [-hVM] [-o outfile] [-l language] [-c category] [-s serial] [-C tag=value] [-R threshold] [-K threshold] -t filetype [ infile ]
DESCRIPTION
kateenc creates Kate streams from input files (SubRip SRT subtitles, LRC lyrics, and libkate's custom description language). When saved to
an Ogg stream (the default behavior), a Kate stream may then be merged with other Ogg streams (eg, a Theora video) using the oggz tools.
OPTIONS -h Show command line help.
-V Show version information.
-M Allow simple HTML-like markup in SRT files. If this parameter is used, strings such as "<i>" will be interpreted to mean italics,
rather than appear as such. Note that various players interpret a slightly different set of HTML tags, and some do not.
-o outfile
Write the output Kate stream to the given file name (writes to stdout if not specified).
-l language
Sets the language for the stream (default is the language specified in the input, or none).
-c category
Sets the category for the stream (default is the category specified in the input, or none).
-s serial
Sets the serial number for the output Kate stream (does not apply to raw streams).
-C tag=value
Adds a comment to encode into the output Kate stream. The comment must be of the form tag=value, and comply with the Vorbis comment
rules (eg, tag is composed of a particular subset of ASCII characters, and value is valid UTF-8). Note that you might have to escape
or quote the comment for it to be seen as a single command line parameter.
-t filetype
Specifies the type of the input (srt, lrc, kate)
-R threshold
Use repeat packets, with the given threshold (in seconds). Data packets will be repeated at intervals of roughly threshold seconds,
while active.
-K threshold
Use keepalive packets, with the given threshold (in seconds). Keepalive packets will be emitted when no other packet has been emit-
ted for roughly threshold seconds.
EXAMPLES
Create a Kate stream for Welsh subtitles from a SubRip file:
kateenc -t srt -l cy -c SUB -o output.ogg input.srt
SEE ALSO katedec(1), katalyzer(1)libkate 0.4.1 13 october 2010 KATEENC(1)