Sponsored Content
Full Discussion: Changing time-stamp with sed
Top Forums Shell Programming and Scripting Changing time-stamp with sed Post 302875415 by IMPe on Tuesday 19th of November 2013 12:23:25 PM
Old 11-19-2013
Quote:
Originally Posted by Corona688
Yes... and then showed an example that matched 1-5. Does he want to round down to ten minutes for low numbers, and up to ten minutes for high ones?

Being unsure, I showed him how backreferences worked and left the rest for him.
Thanks a lot to you and disedorgue and a big sorry for the imprecise description.
what a finally want, was rounding down the decade-minute and it works fine with
Code:
sed 's/:\([0-5]\)[1-5]:/:\10:/g'  file.txt

Thanks,
IMPe
This User Gave Thanks to IMPe For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to MV without changing Time Stamp

Hi, I need to move the set of files, and it should be same time stamp as previous. How to do this? (3 Replies)
Discussion started by: redlotus72
3 Replies

2. Shell Programming and Scripting

Date Time Stamp

I'm trying to write a script that checks the DTS of a file the compares it to the current time. If greater that 60 mins has gone by and the file has not been written to alert. So far I have the time pulled from the file but I dont know how to compare the times against a 60 min difference. ... (2 Replies)
Discussion started by: jarich
2 Replies

3. Shell Programming and Scripting

copying a file without changing date stamp.

Hi, I am using the below copy command, to copy the file sbn to sbn1, cp sbn sbn1 but its changing the date stamp of file sbn1, but i dont want to change the date stamp of sbn1. Could you please help me out in this. (3 Replies)
Discussion started by: shivanete
3 Replies

4. Shell Programming and Scripting

Time stamp calculation

Hi all; I'm relatively new to scripting,I am working on a monitoring script.....where in i have to write subroutine which does the follows: It will check the time stamp of a file ( Oracle remarchive files) and compare it with existing time.If the time difference happen to be more than 90... (6 Replies)
Discussion started by: maverick_here
6 Replies

5. Shell Programming and Scripting

Changing File Time Stamp (Bash Script)

I need some help recovering from a "slight" screwup. We just moved 3 TB of data from one RAID Array to another. Low lever archive files. This was done with a regular cp (for some reason) and now we have lost all the timestamps on the files, and we urgently need to get the timestamps back on these... (7 Replies)
Discussion started by: chj
7 Replies

6. UNIX for Dummies Questions & Answers

How to get the next time stamp in perl?

Hi, I have to find the next time stamp in perl. Here is the code. @time = loaltime(time); print "\n Present time: $time:$time:$time \n"; For example if the time is: "12:55:02" after some process the time becomes 1:00:00. How do i check when it becomes 00:00 i.e from "12:55:02... (0 Replies)
Discussion started by: vanitham
0 Replies

7. Shell Programming and Scripting

regarding time stamp

hi everyone i am facing a strange problem here suppose content of my file is a=1,2,3 b=2,3,4 c=4,5,6 time= now the problem is i want to add value in front of time variable and the value should be i format only "HHMMSS" so it should be like this a=1,2,3 b=2,3,4 c=4,5,6... (3 Replies)
Discussion started by: aishsimplesweet
3 Replies

8. Shell Programming and Scripting

How to get time duration between two human readable time stamp in Unix?

Here is two time I have: Jul 12 16:02:01 Jul 13 01:02:01 and how can I do a simple match to get difference between two time which is 09:00:00 Thanks in advance. (3 Replies)
Discussion started by: ford99
3 Replies

9. Solaris

System time and Cron time stamp not matching

On Solaris 10 server the system date won't match with the timestamp on files created by a cron jobs, Please help here is what i get when i check for system date infodba-ie10ux014:/tcpdv1_ie10/tcadmin/bin\n\r-> date Tue Apr 24 15:27:43 GMT 2012at same time i executed a cron job, and checked... (4 Replies)
Discussion started by: karghum
4 Replies

10. Shell Programming and Scripting

Difference between time stamp

Hi All i have a file data like below format A, B 2016-04-14 16:30:00,2016-04-14 16:31:17 2016-04-14 16:40:00,2016-04-14 16:41:10 2016-04-14 16:50:00,2016-04-14 16:50:41 2016-04-14 17:00:00,2016-04-14 17:00:35 2016-04-14 17:10:00,2016-04-14 17:11:48 2016-04-14 17:20:00,2016-04-14 17:20:37 i... (2 Replies)
Discussion started by: Tarak_nath
2 Replies
regcoords(7)							SAORD Documentation						      regcoords(7)

NAME
RegCoords - Spatial Region Coordinates SYNOPSIS
This document describes the specification of coordinate systems, and the interpretation of coordinate values, for spatial region filtering. DESCRIPTION
Pixel coordinate systems The default coordinate system for regions is PHYSICAL, which means that region position and size values are taken from the original data. (Note that this is a change from the original IRAF/PROS implementation, in which the IMAGE coordinate system was the default.) PHYSICAL coordinates always refer to pixel positions on the original image (using IRAF LTM and LTV keywords). With PHYSICAL coordinates, if a set of coordinates specifies the position of an object in an original FITS file, the same coordinates will specify the same object in any FITS derived from the original. Physical coordinates are invariant with blocking of FITS files or taking sections of images, even when a blocked section is written to a new file. Thus, although a value in pixels refers, by default, to the PHYSICAL coordinate system, you may specify that position values refer to the image coordinate system using the global or local properties commands: global coordsys image circle 512 512 100 The global command changes the coordinate system for all regions that follow, while the local command changes the coordinate system only for the region immediately following: local coordsys image circle 512 512 100 circle 1024 1024 200 This changes the coordinate system only for the region that follows. In the above example, the second region uses the global coordinate system (PHYSICAL by default). World Coordinate Systems If World Coordinate System information is contained in the data file being filtered, it also is possible to define regions using a sky coordinate system. Supported systems include: name description ---- ----------- PHYSICAL pixel coords of original file using LTM/LTV IMAGE pixel coords of current file FK4, B1950 sky coordinate systems FK5, J2000 sky coordinate systems GALACTIC sky coordinate systems ECLIPTIC sky coordinate systems ICRS currently same as J2000 LINEAR linear wcs as defined in file In addition, two mosaic coordinate systems have been defined that utilize the (evolving) IRAF mosaic keywords: name description ---- ----------- AMPLIFIER mosaic coords of original file using ATM/ATV DETECTOR mosaic coords of original file using DTM/DTV Again, to use one of these coordinate systems, the global or local properties commands are used: global coordsys galactic WCS Positions and Sizes In addition to pixels, positional values in a WCS-enabled region can be specified using sexagesimal or degrees format: position arguments description ------------------ ----------- [num] context-dependent (see below) [num]d degrees [num]r radians [num]p physical pixels [num]i image pixels [num]:[num]:[num] hms for 'odd' position arguments [num]:[num]:[num] dms for 'even' position arguments [num]h[num]m[num]s explicit hms [num]d[num]m[num]s explicit dms If ':' is used as sexagesimal separator, the value is considered to be specifying hours/minutes/seconds if it is the first argument of a positional pair, and degrees/minutes/seconds for the second argument of a pair (except for galactic coordinates, which always use degrees): argument description ----------- ----------- 10:20:30.0 10 hours, 20 minutes, 30 seconds for 1st positional argument 10 degrees, 20 minutes, 30 seconds for 2nd positional argument 10h20m30.0 10 hours, 20 minutes, 30 seconds 10d20m30.0 10 degrees, 20 minutes, 30 seconds 10.20d 10.2 degrees Similarly, the units of size values are defined by the formating character(s) attached to a number: size arguments description -------------- ----------- [num] context-dependent (see below) [num]" arc seconds [num]' arc minutes [num]d degrees [num]r radians [num]p physical pixels [num]i image pixels For example: argument description ----------- ----------- 10 ten pixels 10' ten minutes of arc 10" ten seconds of arc 10d ten degrees 10p ten pixels 0.5r half of a radian An example of using sky coordinate systems follows: global coordsys B1950 -box 175.54d 20.01156d 10' 10' local coordsys J2000 pie 179.57d 22.4d 0 360 n=4 && annulus 179.57d 22.4d 3' 24' n=5 At the FK4 1950 coordinates 175.54d RA, 20.01156d DEC exclude a 10 minute by 10 minute box. Then at the FK5 2000 coordinates 179.57d RA 22.4d DEC draw a radial profile regions pattern with 4 quadrants and 5 annuli ranging from 3 minutes to 24 minutes in diameter. In this example, the default coordinate system is overridden by the commands in the regions spec. NB - The Meaning of Pure Numbers Are Context Sensitive When a "pure number" (i.e. one without a format directive such as 'd' for 'degrees') is specified as a position or size, its interpretation depends on the context defined by the 'coordsys' keyword. In general, the rule is: All pure numbers have implied units corresponding to the current coordinate system. If no coordinate system is explicitly specified, the default system is implicitly assumed to be PHYSICAL. In practice this means that for IMAGE and PHYSICAL systems, pure numbers are pixels. Otherwise, for all systems other than LINEAR, pure numbers are degrees. For LINEAR systems, pure numbers are in the units of the linear system. This rule covers both positions and sizes. As a corollary, when a sky-formatted number is used with the IMAGE or PHYSICAL coordinate system (which includes the default case of no coordsys being specified), the formatted number is assumed to be in the units of the WCS contained in the current file. If no sky WCS is specified, an error results. Examples: circle(512,512,10) ellipse 202.44382d 47.181656d 0.01d 0.02d In the absence of a specified coordinate system, the circle uses the default PHYSICAL units of pixels, while the ellipse explicitly uses degrees, presumably to go with the WCS in the current file. global coordsys=fk5 global color=green font="system 10 normal" circle 202.44382 47.181656 0.01 circle 202.44382 47.181656 10p ellipse(512p,512p,10p,15p,20) Here, the circles use the FK5 units of degrees (except for the explicit use of pixels in the second radius), while the ellipse explicitly specifies pixels. The ellipse angle is in degrees. Note that Chandra data format appears to use "coordsys=physical" implicitly. Therefore, for most Chandra applications, valid regions can be generated safely by asking ds9 to save/display regions in pixels using the PHYSICAL coordsys. SEE ALSO
See funtools(7) for a list of Funtools help pages version 1.4.2 January 2, 2008 regcoords(7)
All times are GMT -4. The time now is 09:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy