Sponsored Content
Full Discussion: handling date field
Top Forums Shell Programming and Scripting handling date field Post 302113131 by vgersh99 on Tuesday 3rd of April 2007 04:46:44 PM
Old 04-03-2007
Code:
echo '03302007' | sed 's#\(..\)\(..\)\(....\)#\3\1\2#'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Date Handling

In the shell which have the command prompt '$' ( Sorry i dunno wat shell is this), is there anyway to handle date input? Coz i need to accept a date from the user and wat i use is: read day;read month; read year; In this case user need to enter 3 time, is it any better way? Summore, is... (1 Reply)
Discussion started by: AkumaTay
1 Replies

2. Shell Programming and Scripting

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... (6 Replies)
Discussion started by: sabercats
6 Replies

3. 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

4. Shell Programming and Scripting

Sort two columns in a field, one of them being a date

Hi, I have a set of columns in a csv file, my first row being an integer and 2nd being a date. I want to first sort it using the first column and then by the second. for e.g. i have , 1234,09/05/2009,hi 5678,01/01/2008,hi 1234,11/03/2006,hello 5678,28/07/2010,hello i tried this... (5 Replies)
Discussion started by: sweta_doshi
5 Replies

5. 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

6. 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

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. AIX

Sort by date field in AIX

I wanted to sort the below data on 4th field(comma seperator) based on month and date and time on AIX OS. Input data: 3,AJ,30 Jul 06:30,30 Jul 06:30 5,AJ,30 Jul 06:30,30 Jul 06:49 10,AJ,30 Jul 06:30,02 Jan 05:41 4,AJ,30 Jul 06:30,30 Jul 06:36 2,AJ,30 Jul 06:30,28 Jul 06:45 9,AJ,30 Jul... (2 Replies)
Discussion started by: Amit Joshi
2 Replies
PHP_STRIP_WHITESPACE(3) 						 1						   PHP_STRIP_WHITESPACE(3)

php_strip_whitespace - Return source with stripped comments and whitespace

SYNOPSIS
string php_strip_whitespace (string $filename) DESCRIPTION
Returns the PHP source code in $filename with PHP comments and whitespace removed. This may be useful for determining the amount of actual code in your scripts compared with the amount of comments. This is similar to using php -w from the commandline. PARAMETERS
o $filename - Path to the PHP file. RETURN VALUES
The stripped source code will be returned on success, or an empty string on failure. Note This function works as described as of PHP 5.0.1. Before this it would only return an empty string. For more information on this bug and its prior behavior, see bug report #29606. EXAMPLES
Example #1 php_strip_whitespace(3) example <?php // PHP comment here /* * Another PHP comment */ echo php_strip_whitespace(__FILE__); // Newlines are considered whitespace, and are removed too: do_nothing(); ?> The above example will output: <?php echo php_strip_whitespace(__FILE__); do_nothing(); ?> Notice the PHP comments are gone, as are the whitespace and newline after the first echo statement. PHP Documentation Group PHP_STRIP_WHITESPACE(3)
All times are GMT -4. The time now is 03:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy