Sponsored Content
Full Discussion: Arrange date in a field
Top Forums Shell Programming and Scripting Arrange date in a field Post 100566 by sabercats on Tuesday 28th of February 2006 12:54:34 PM
Old 02-28-2006
Arrange date in a field

Hi all,

If I have a flat file
ID|Location|Date|Hostname|Age|Sex
1|SFO|06/02/24 12:12:34|hawkeye|35|M
2|LAX|06/02/24 13:12:35|sf49ers|30|M
3|OAK|06/02/25 11:12:36|goraiders|27|F
4|PIT|06/02/25 12:12:37|steeler|35|M

How can I create an output
1|SFO|02/24/2006 12:12:34|hawkeye|35|M
2|LAX|02/24/2006 13:12:35|sf49ers|30|M
3|OAK|02/25/2006 11:12:36|goraiders|27|F
4|PIT|02/25/2006 12:12:37|steeler|35|M

Thanks .
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

handling date field

Hi, Is there any way we could change the date format listed below... date I get is 03302007 (MMDDYYYY) I need to change it to 20070330 (YYYYMMDD) Thanks. (3 Replies)
Discussion started by: mgirinath
3 Replies

2. Shell Programming and Scripting

How to Sort files on date field

:cool: Hi all, I have a pecular issue in sorting these files in Solaris environment. All the below files are modified on November 4th, but I want to sort these files as per date column (eg: 01May07_1623 = ddmmmyy_hhmm) Nov 4 18:27 SONYELEC00.GI22973.01May07_1623.gpg Nov 4 18:27... (4 Replies)
Discussion started by: shivaastrogun
4 Replies

3. Shell Programming and Scripting

Keeping padding in a date field

Hi Guys, I'm having a bit of a problem with a script, i need to get the day, month and day of month into a string, so i'm using: CURRENT_DATE=`date +"%a %b %e"` It is getting the correct date out, however it is not keeping the padding on the day of month. The %e is supposed to pad the day... (5 Replies)
Discussion started by: seanbyrne
5 Replies

4. Shell Programming and Scripting

date field manipulation

I have a data file. Seperated by "|". The 19 th filed is a date field that occurs like this 11/02/2001 i need to convert into the below format 2001-11-02 for e.g.. i/p o/p should be can somebody throw some light (5 Replies)
Discussion started by: dsravan
5 Replies

5. UNIX for Advanced & Expert Users

change field 2 date format

from this input WEBELSOLAR,29122009,1:1 WIPRO,15062010,2:3 ZANDUREALT,18012007,1:3 i want output as WEBELSOLAR,20091229,1:1 WIPRO,20100615,2:3 ZANDUREALT,20070118,1:3 basically input is in ddmmyyyy format and i was to convert it to yyyymmdd format (1 Reply)
Discussion started by: manishma71
1 Replies

6. Shell Programming and Scripting

Sorting Date Field with Sort -k :/

SOLVED : (17 Replies)
Discussion started by: Glitch100
17 Replies

7. Shell Programming and Scripting

Check if a date field has date or timestamp or date&timestamp

Hi, In a field, I should receive the date with time stamp in a particular field. But sometimes the vendor sends just the date or the timestamp or correctl the date&timestamp. I have to figure out the the data is a date or time stamp or date&timestamp. If it is date then append "<space>00:00:00"... (1 Reply)
Discussion started by: machomaddy
1 Replies

8. Linux

How do I format a Date field of a .CSV file with multiple commas in a string field?

I have a .CSV file (file.csv) whose data are all enclosed in double quotes. Sample format of the file is as below: column1,column2,column3,column4,column5,column6, column7, Column8, Column9, Column10 "12","B000QRIGJ4","4432","string with quotes, and with a comma, and colon: in... (3 Replies)
Discussion started by: dhruuv369
3 Replies

9. Shell Programming and Scripting

Removing date field from the string

Hii I am trying to remove the date field from the following string. ODS_EPP_COVRG_STN_DETL_FILE_10032014.TXT. My output should be ODS_EPP_COVRG_STN_DETL_FILE.TXT I tried couple of things: echo ODS_EPP_COVRG_STN_DETL_FILE_10032014.TXT|sed 's/_*\.*//g' I am getting:... (9 Replies)
Discussion started by: skatpally
9 Replies

10. OS X (Apple)

Arrange file by modified date

Hi, Am performing a find based on filename and result can contain multiple files being found Let's say my find command is find /Archive -f -name 12345.pdf and result of find command is /Archive/Folder A/12345.pdf /Archive/Folder B/12345.pdf please note white space in folder names I... (2 Replies)
Discussion started by: gigagigosu
2 Replies
ost::Date(3)						     Library Functions Manual						      ost::Date(3)

NAME
ost::Date - The Date class uses a julian date representation of the current year, month, and day. SYNOPSIS
#include <numbers.h> Inherited by ost::DateNumber, and ost::Datetime. Public Member Functions Date (time_t tm) Date (tm *dt) Date (char *str, size_t size=0) Date (int year, unsigned month, unsigned day) Date () virtual ~Date () int getYear (void) const unsigned getMonth (void) const unsigned getDay (void) const unsigned getDayOfWeek (void) const char * getDate (char *buffer) const time_t getDate (void) const time_t getDate (tm *buf) const long getValue (void) const void setDate (const char *str, size_t size=0) bool isValid (void) const operator long () const String operator() () const Date & operator++ () Date & operator-- () Date & operator+= (const long val) Date & operator-= (const long val) int operator== (const Date &date) int operator!= (const Date &date) int operator< (const Date &date) int operator<= (const Date &date) int operator> (const Date &date) int operator>= (const Date &date) bool operator! () const Protected Member Functions void toJulian (long year, long month, long day) void fromJulian (char *buf) const virtual void update (void) A method to use to 'post' any changed values when shadowing a mixed object class. Protected Attributes long julian Friends Date operator+ (const Date &date, const long val) Date operator- (const Date &date, const long val) Date operator+ (const long val, const Date &date) Date operator- (const long val, const Date &date) Detailed Description The Date class uses a julian date representation of the current year, month, and day. This is then manipulated in several forms and may be exported as needed. Author: David Sugar dyfet@ostel.com julian number based date class. Constructor &; Destructor Documentation ost::Date::Date (time_ttm) ost::Date::Date (tm *dt) ost::Date::Date (char *str, size_tsize = 0) ost::Date::Date (intyear, unsignedmonth, unsignedday) ost::Date::Date () virtual ost::Date::~Date () [virtual] Member Function Documentation void ost::Date::fromJulian (char *buf) const [protected] char* ost::Date::getDate (char *buffer) const time_t ost::Date::getDate (void) const time_t ost::Date::getDate (tm *buf) const unsigned ost::Date::getDay (void) const unsigned ost::Date::getDayOfWeek (void) const unsigned ost::Date::getMonth (void) const long ost::Date::getValue (void) const int ost::Date::getYear (void) const bool ost::Date::isValid (void) const Reimplemented in ost::Datetime. ost::Date::operator long () const [inline] bool ost::Date::operator! (void) const [inline] Reimplemented in ost::Datetime. int ost::Date::operator!= (const Date &date) String ost::Date::operator() () const Date& ost::Date::operator++ () Date& ost::Date::operator+= (const longval) Date& ost::Date::operator-- () Date& ost::Date::operator-= (const longval) int ost::Date::operator< (const Date &date) int ost::Date::operator<= (const Date &date) int ost::Date::operator== (const Date &date) int ost::Date::operator> (const Date &date) int ost::Date::operator>= (const Date &date) void ost::Date::setDate (const char *str, size_tsize = 0) void ost::Date::toJulian (longyear, longmonth, longday) [protected] virtual void ost::Date::update (void) [protected], [virtual] A method to use to 'post' any changed values when shadowing a mixed object class. This is used by DateNumber. Reimplemented in ost::DateNumber. Friends And Related Function Documentation Date operator+ (const Date &date, const longval) [friend] Date operator+ (const longval, const Date &date) [friend] Date operator- (const Date &date, const longval) [friend] Date operator- (const longval, const Date &date) [friend] Member Data Documentation long ost::Date::julian [protected] Author Generated automatically by Doxygen for GNU CommonC++ from the source code. GNU CommonC++ Sat Jun 23 2012 ost::Date(3)
All times are GMT -4. The time now is 06:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy