I have data that looks like this
aaa!bbb!ccc/ddd/eee
It is not fixed format. I need to parse ddd into a var in order to decide if I want to process that row. If I do I need to put ccc and bbb into vars to process it. I need to do this during a while loop one record at a time. Any... (11 Replies)
Is there a betterway to cut certain columns in everyline based on positions.
Basically, I have a largefile and eachline is of 1000 characters and I need to cut the characters 17-30, 750-775, 776-779, 780-805
while
do
fptr=`cat $tempfile | head -$i | tail -1`
... (4 Replies)
I have a file with the following format
12g data/datasets/cct 8g data/dataset/cct
10 g data/two 5g data/something_different
10g something_different
5g data/two
is there a way to loop through this... (1 Reply)
Hi,
I'm using awk in HP-UX machine which does not support systime(), strftime(). So to get the date time I was using :
seq 1 100000 | awk ' "date +%Y%m%d%H%M%s" | getline curtime; print curtime }'
However the above code gets the date only once, next time it is not updated. For... (2 Replies)
Hello All,
I am new to shell scripting and programming. I am looking for a guide on how I can parse specific information from a plain text file with thousands of lines. Specifically I need to parse an email address from each line. The line looks something like this:... (9 Replies)
Good afternoon!
I have an XML file from which I want to extract only certain elements contained within each line. The problem is that the format of each line is not exactly the same (though similiar). For example, oa_var will be in each line, however, there may be no value or other... (3 Replies)
Hello,
I want to add a letter to the end of a string if it repeats in a column.
so if I have a file like this:
DOG001
DOG0023
DOG004
DOG001
DOG0023
DOG001
the output should look like this:
DOG001-a
DOG0023-a
DOG004
DOG001-b (15 Replies)
I am executing df -mP to see the disk utilization.
I would like to append servername also to each and every line.
df -mP | awk '{ print $1","$2","$3","$4","$5","$6 }'
trying to add something like this
df -mP | awk '{ print $1","$2","$3","$4","$5","$6","$hostname }' ... (1 Reply)
All,
I have a sample text like below.
Key (Header)
Key1
ABC
Key2
ABC
Key3
ABC
ABC
Key4
ABC
Key5
ABC
ABC
ABC
Required Output
Key (Header)
Key1 (2 Replies)
Another project, another bump in the road and another chance to learn. I've been trying to open gzipped files and parse data from them and hit a snag. I have data in gzips with a place followed by an ip or ip range sort of like this:
Some place:x.x.x.x-x.x.x.x
I was able to modify some code... (6 Replies)
Discussion started by: Azrael
6 Replies
LEARN ABOUT DEBIAN
pycdg
PYCDG(6)PYCDG(6)NAME
pykaraoke - free CDG/MIDI/MPEG karaoke player
SYNOPSIS
pycdg [ options ] songfilename.cdg
OVERVIEW
pykaraoke is a free karaoke player for Linux, FreeBSD and Windows.
pycdg is a CDG karaoke player which supports MP3+G and OGG+G tracks.
The player uses the pygame library (www.pygame.org), and can therefore run on any operating system that runs pygame (currently Linux, Free-
BSD, Windows and OSX).
You can use this file as a standalone player, or together with PyKaraoke. PyKaraoke provides a graphical user interface, playlists, search-
able song database etc.
For those writing a media player or similar project who would like CDG support, this module has been designed to be easily incorporated
into such projects and is released under the LGPL.
Numeric module (numpy.sourceforge.net) is required only if you do not use the compiled C low-level CDG implementation in _pycdgAux.c
USAGE
To start the player, pass the CDG filename/path on the command line:
python pycdg.py /path/song.cdg
You can also incorporate a CDG player in your own projects by importing this module. The class cdgPlayer is exported by the module. You can
import and start it as follows:
import pycdg
player = pycdg.cdgPlayer("/path/song.cdg")
player.Play()
If you do this, you must also arrange to call pycdg.manager.Poll() from time to time, at least every 100 milliseconds or so, to allow the
player to do its work.
The class also exports Close(), Pause(), Rewind(), GetPos().
There are two optional parameters to the initialiser, errorNotifyCallback and doneCallback:
errorNotifyCallback, if provided, will be used to print out any error messages (e.g. song file not found). This allows the module to fit
together well with GUI playlist managers by utilising the same GUI's error popup window mechanism (or similar). If no callback is provided,
errors are printed to stdout. errorNotifyCallback should take one parameter, the error string, e.g.:
def errorPopup (ErrorString):
msgBox (ErrorString)
doneCallback can be used to register a callback so that the player calls you back when the song is finished playing. The callback should
take no parameters, e.g.:
def songFinishedCallback():
msgBox ("Song is finished")
To register callbacks, pass the functions in to the initialiser:
cdgPlayer ("/path/song.cdg", errorPopup, songFinishedCallback)
These parameters are optional and default to None.
If the initialiser fails (e.g. the song file is not present), __init__ raises an exception.
OPTIONS
pycdg also takes various command-line options for setting the window size, position, and update rate. Type the following for a full list of
options:
$ pycdg --help
SEE ALSO
You can find PyKaraoke's home page at: http://www.kibosh.org/pykaraoke/
AUTHOR
PyKaraoke was written by Kelvin Lawson <kelvinl@users.sourceforge.net> and William Ferrell <willfe@gmail.com>.
This manual page was written by Miriam Ruiz <little_miry@yahoo.es>, for the Debian project (but may be used by others).
july 16, 2006 PYCDG(6)