09-12-2011
To separate on a longer string, make the separator the longer string...
awk -v FS="\",\"" ...
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am new to using Sed. I have a file containg lines like the following:
INFORM----Test.pc:168:10/11/05 12:34:26 > some text goes here..
TRACE-----Test.pc:197:10/11/05 12:34:26 > some text goes here..
My requirement is to replace 10/11/05 12:34:26 with a string <RUNDATE> (including <... (4 Replies)
Discussion started by: Hema_M
4 Replies
2. Shell Programming and Scripting
hi
awk script for dd/mm/yyyy to yyyymmdd
awk script for dd-mon-yyyy to yyyymmdd
awk script for dd-mm-yyyy to yyyymmdd formate
..............urgent.............
Thanks in advanced (2 Replies)
Discussion started by: charandevu
2 Replies
3. Shell Programming and Scripting
hi all,
for an example :
df -k output shows:
$ df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p6 3099260 1117760 1824068 8% /
/dev/cciss/c0d0p1 256666 18065 225349 8% /boot
none 8219180 0 8219180 0% /dev/shm
/dev/mapper/vglocal-home
1032088 245172 734488 26%... (7 Replies)
Discussion started by: raghur77
7 Replies
4. Shell Programming and Scripting
I am writing a shell script that checks all .c files to see if they use fprintf or printf. If a file does, then the line #include <stdio.h> is added to the top of the file, unless it's already there.
This is what I've got:
#!/bin/sh
egrep -l f?printf *.c | while read file;
do sed -i '1i\... (2 Replies)
Discussion started by: computethis
2 Replies
5. Shell Programming and Scripting
I have the words in twiki format that I want to convert to mediawiki format like below :
%BLUE%some words1%ENDCOLOR%
bla bla blab labdad sdadasd adsasdads oerdkfj kdfjs %PINK%some wordks2 123.4.5.6/26%ENDCOLOR%, ksdjak dkasjd kjfrjkfgjdkfgjdfkgjdgdfgdgf %PURPLE%1.2.3.4/28%ENDCOLOR%, dskd... (3 Replies)
Discussion started by: rk4k
3 Replies
6. Shell Programming and Scripting
Hi,
I've few files in the following format
file 1
-------------------------
A=a1 B=0 C=1 D=3
A=a2 B=0 C=1 D=3
A=a3 B=0 C=6 D=7
A=a4 B=0 C=1 D=3
A=a5 B=0 C=1 D=3
file 2
-------------------------
A=a1 B=2 C=2 D=4
A=a2 ... (2 Replies)
Discussion started by: skpvalvekar
2 Replies
7. UNIX for Advanced & Expert Users
Hi,
I would like to convert the output from awk function to date and print on the screen.
Example : echo "Start Date: May 24 2010" | gawk -F": " '{print $2}'
Output : May 04 2010
I want this to be converted to 2010/05/24
Can i use date function here and how?
Thanks,
Deepika (2 Replies)
Discussion started by: deepikad
2 Replies
8. Shell Programming and Scripting
Hello;
I have the following commnad:
ls -lrt /ulogs/dblocks_logs/*log |awk '{print "grep Total "$9" |tail -20"}' | sh
05/10/11 21:54:01 Total number of locks:0
05/10/11 21:55:01 Total number of locks:0
05/10/11 21:56:01 Total number of locks:2
05/10/11 21:57:00 Total number of... (8 Replies)
Discussion started by: delphys
8 Replies
9. Shell Programming and Scripting
I have a script below and wanted to change the output into three different file format (3 separate script)
#!bin/bash
#input file format postwrf_d01_20131206_0600_f08400.grb2
#postwrf_d01_YYYYMMDD_ZZZZ_f0HHHH.grb2
#zzzz= 0000,0600,1200,1800 (in UTC)
#HHHH=00000,00600,01200,01800 ..ect (in... (1 Reply)
Discussion started by: cumulus_255
1 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I have a file where I need to change the date format on the nth field from DD-MM-YYYY to YYYY-MM-DD so I can accurately sort the record by dates
From regex - Use sed or awk to fix date format - Stack Overflow, I found an example using nawk.
Test run as below:
$: cat xyz.txt
A ... (2 Replies)
Discussion started by: newbie_01
2 Replies
LEARN ABOUT DEBIAN
get_midi_length
get_midi_length(3alleg4) Allegro manual get_midi_length(3alleg4)
NAME
get_midi_length - Determines the total playing time of a midi, in seconds. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
int get_midi_length(MIDI *midi);
DESCRIPTION
This function will simulate playing the given MIDI, from start to end, to determine how long it takes to play. After calling this function,
midi_pos will contain the negative number of beats, and midi_time the length of the midi, in seconds.
Note that any currently playing midi is stopped when you call this function. Usually you would call it before play_midi, to get the length
of the midi to be played, like in this example:
length = get_midi_length(my_midi);
play_midi(my_midi);
do {
pos = midi_time;
textprintf_ex(screen, font, 0, 0, c, -1, "%d:%02d / %d:%02d
",
pos / 60, pos % 60, length / 60, length % 60);
rest(100);
} while(pos <= length);
RETURN VALUE
Returns the value of midi_time, the length of the midi.
SEE ALSO
load_midi(3alleg4), midi_time(3alleg4), midi_pos(3alleg4), exmidi(3alleg4)
Allegro version 4.4.2 get_midi_length(3alleg4)