Sponsored Content
Full Discussion: Making times mysql compliant
Top Forums UNIX for Dummies Questions & Answers Making times mysql compliant Post 302591907 by figaro on Saturday 21st of January 2012 01:13:31 PM
Old 01-21-2012
Making times mysql compliant

I have the following file:
Code:
Loc1,20080102,230100,0.5617,0.5617
Loc1,20080102,230400,0.5616,0.5616
Loc1,20080102,230700,0.5615,0.5615

Then I use the following code to turn the third column into something which to mysql has the time datatype:

Code:
sed -i '' -e "s#,\(..\)\(..\)\(..\),#,\1:\2:\3,#" file.dat

It correctly transforms the third column into times:

Code:
Loc1,20080102,23:01:00,0.5617,0.5617
Loc1,20080102,23:04:00,0.5616,0.5616
Loc1,20080102,23:07:00,0.5615,0.5615

What I am wondering is why the fourth column is unaffected, since it also has 6 characters and has a comma (,) on both sides. Is because of the decimal point (.)?
 

6 More Discussions You Might Find Interesting

1. AIX

how would you know your server was rebooted 3 times or 5 times

Is there such location or command to know how many times did you reboot your server in that particular day?in AIX. (3 Replies)
Discussion started by: kenshinhimura
3 Replies

2. Programming

Is gcc compliant with the C++ standards

Hello Friends, I am a newbie and have started using different compilers and tools to make myself familiar with their workings. I wanted to know that how compliant is gcc with the C++ standards. It is pretty obvious that no compiler is close to being completely compliant, but if there are some... (7 Replies)
Discussion started by: hthapar
7 Replies

3. Programming

Problem with implementing the times() function in C (struct tms times return zero/negative values)

Hello, i'm trying to implement the times() function and i'm programming in C. I'm using the "struct tms" structure which consists of the fields: The tms_utime structure member is the CPU time charged for the execution of user instructions of the calling process. The tms_stime structure... (1 Reply)
Discussion started by: g_p
1 Replies

4. Shell Programming and Scripting

Logical expression in POSIX compliant Korn Shell

Hi, i want to check if a variable var1 is not a or b or c pseudo code: If NOT (var1 = a or var1 = b or var1 = c) then ... fi I want to use POSIX complaint Korn shell, and for string comparison For the following code, logical.sh #!/usr/bin/ksh var="j" echo "Var : $var" if ! { || ||... (12 Replies)
Discussion started by: ysrini
12 Replies

5. Shell Programming and Scripting

Q: Is SQRT(n) possible in a POSIX compliant shell? A: Yes within limits.

Hi all... This is just a fun project to see if it is possible to get a square root of a positive integer from 1 to 9200000 to 6 decimal places on a 64 bit architecture machine. It is coded around dash and the results show the values from 0 to 10000. Complex numbers can easily be catered for by... (3 Replies)
Discussion started by: wisecracker
3 Replies

6. OS X (Apple)

Generate a random number in a fully POSIX compliant shell, 'dash'...

Hi all... Apologies for any typos, etc... This took a while but it didn't beat me... Although there are many methods of generating random numbers in a POSIX shell this uses integer maths and a simple C source to create an executable to get epoch to microseconds accuracy if it is needed. I take... (8 Replies)
Discussion started by: wisecracker
8 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 01:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy