Sponsored Content
Full Discussion: Add Date in Column data
Top Forums UNIX for Beginners Questions & Answers Add Date in Column data Post 303046156 by pareshkp on Saturday 25th of April 2020 02:57:59 PM
Old 04-25-2020
HI

I have tried something below ..

Code:
sed 's/.*\:\(... ... .. ..:..:.. ....\) .*/\1/' $inputfiel

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to add a new line between different column data content?

Input file: Germany 10 500 5000 Germany 20 500 5000 Germany 50 10 500 England 5 10 25 USA 30 25 55 USA 20 35 90 Japan 2 5 60 Singapore 50 30 90 Singapore 150 230 290 Output file: Germany 10 500 5000 Germany 20 500 5000 Germany 50 10 500 England 5 10 25 (7 Replies)
Discussion started by: patrick87
7 Replies

2. Shell Programming and Scripting

Awk to add selected row column data

Looks at the most efficient way to add up the column of data based off of the rows. Random data Name-Number-ID Sarah-2.0-15 Bob-6.3-15 Sally-1.0-10 James-1.0-10 Scotty-10.7-15 So I would select all those who have ID = 15 and then add up total number read - p "Enter ID number" Num ... (3 Replies)
Discussion started by: Ironguru
3 Replies

3. Ubuntu

How to add a data column in existing file

Hi All I need to add a column on my existing data file. I know similar posts are there but none of them were meeting my requirement. My input is 1.20 3.44 4.88 5.11 4.99 3.22 1.89 3.89 2.90 Desired output 1 1.20 3.44 4.88 2 5.11 4.99 3.22 3 1.89 3.89 2.90 I will... (2 Replies)
Discussion started by: mahbub03
2 Replies

4. Emergency UNIX and Linux Support

Trying to add currrent date as the first the first column in the file

Hi Experts, I am trying to add one variable value as the first value in a file speparated by "" (space) delimiter. Can you please let me know how I can do this using bash script. Following is my file. 1635 ABCD 3m9ka COMPLETE 0526 AJAY 3m1da COMPLETE 0419 INDIA 3m3zi INCOMPLETE The... (3 Replies)
Discussion started by: ajaypatil_am
3 Replies

5. Shell Programming and Scripting

Add current date to the data file

hi all Please assist i need to add current date as data to load to a database: the script is as follow: #!/bin/ksh DIR=/export/home/yani_m/scripts/scrip_out_put/ DIR2=/export/home/yani_m/scripts/scrip_out_put/calc/ Date=$1 File22="disk_"$Date Server=$2 iofiles=$DIR"/*"$Date"*_Ynr.dat"... (4 Replies)
Discussion started by: LucyYani
4 Replies

6. Shell Programming and Scripting

Sort data by date and then search by column

Hi, I have a file where data is pipe separated.First i want to sort the file content by date . Then i want to pick up the records based on the first column which should be unique and not have duplicates. NYSE|yyyrrrddd|toronto|isin|ticker|2013-05-15... (2 Replies)
Discussion started by: samrat dutta
2 Replies

7. Shell Programming and Scripting

Need to add a date column (today's date) in file

Hi I have file with number status and date1 and date1 field, want add a column today between column date1 and date2. file1.txt number status date1 date2 ===== ==== === ===== 34567 open 27/06/13 28/06/13 45678 open 27/06/13 28/06/13 43567 open 27/06/13 28/06/13 ... (1 Reply)
Discussion started by: vijay_rajni
1 Replies

8. UNIX for Advanced & Expert Users

Add file creation date as new column

Hi , I have a requirement to append file creation date to each row in a file for all the files in a directory. Please help Thanks, Pavan (2 Replies)
Discussion started by: Pavan Ram B S
2 Replies

9. Shell Programming and Scripting

Add Column base on other Column Data

HI Guys, I want add one extra Column base on 3rd Column . Input :- M204 MS204_154 :vsDataUeMe M204 MS204_154 es:sMeasure 0 M204 MS204_154 es:90ilterCoe 9 M204 MS204_154 es:searchE9090ortTime 40 M204 MS204_154 es:servOrPrioI90HoTimer 4000 M204 MS204_154 es:ueMeajllls154545 TRUE... (5 Replies)
Discussion started by: pareshkp
5 Replies

10. UNIX for Beginners Questions & Answers

How to add a column of another data from another column?

Hola Como hacer: C:\System\SystemRun.4gl C:\System\SystemRunPrint.4gl C:\System\SystemViews.4gl Resultado: SystemRun.4gl C:\System\SystemRun.4gl SystemRunPrint.4gl C:\System\SystemRunPrint.4gl SystemViews.4gl C:\System\SystemViews.4gl... (0 Replies)
Discussion started by: tlaloc
0 Replies
Date::Manip::Obj(3)					User Contributed Perl Documentation				       Date::Manip::Obj(3)

NAME
Date::Manip::Obj - Base class for Date::Manip objects SYNOPSIS
The Date::Manip::Obj class is the base class used for the following Date::Manip classes: Date::Manip::Base Date::Manip::TZ Date::Manip::Date Date::Manip::Delta Date::Manip::Recur This module is not intended to be called directly and performs no useful function by itself. Instead, use the various derived classes which inherit from it. DESCRIPTION
This module contains a set of methods used by all Date::Manip classes listed above. You should be familiar with the Date::Manip::Objects and Date::Manip::Config documentation. In the examples below, Date::Manip::Date objects will be used as examples, but (unless otherwise stated), all of the classes listed above have the same methods, and work in the same fashion. METHODS FOR CREATING OBJECTS
new $date = new Date::Manip::Date; $date = new Date::Manip::Date @opts; $date = new Date::Manip::Date $string; $date = new Date::Manip::Date $string,@opts; In order to create the first Date::Manip object, use any of the forms listed above. They will all create a new Date::Manip::Date object (with new Date::Manip::Base, and Date::Manip::TZ objects embedded in it). The Date::Manip::Date, Date::Manip::Delta, and Date::Manip::Recur classes work in exactly the same way. A set of options (described in the Date::Manip::Config documentation) can be passed to the object to set configuration variables. In addition, a string can be passed in which will be parsed to form the initial date stored in the object. Strings can also be passed in to the Date::Manip::Delta and Date::Manip::Recur objects which will be parsed to form initial values. In all cases, refer to the parse method of the class. $dmt = new Date::Manip::TZ; $dmt = new Date::Manip::TZ @opts; If the first Date::Manip object you need is a Date::Manip::TZ object, use either of the above calls. This will also create a Date::Manip::Base object which will be embedded in the Date::Manip::TZ object. A set of options can be passed in as well, but there is no option for passing in a string. $dmb = new Date::Manip::Base; $dmb = new Date::Manip::Base @opts; If you work with Date::Manip::Base objects directly, no other object will be created. The options can be passed in here as well. Once a Date::Manip::Date object (or any object in any other Date::Manip class) is created, one of calls below should be used in order to preserve cached data in the interest of performance and memory usage. $date = new Date::Manip::Date $obj; $date = new Date::Manip::Date $obj,@opts; $date = new Date::Manip::Date $obj,$string; $date = new Date::Manip::Date $obj,$string,@opts; $obj can be an object from any of the Date::Manip classes, but in the interest of making efficient use of cached data, you should pass in the highest level object available. In other words, you should always pass in a Date::Manip::Date, Date::Manip::Delta, or Date::Manip::Recur object if you have one. In their absence, pass in a Date::Manip::TZ object. Pass in a Date::Manip::Base object only if that is the only Date::Manip object available. The one caveat is if you are working with multiple configurations as described in the Date::Manip::Objects document. In that case, additional care should be taken to make sure that the correct object is passed in. If $obj is a Date::Manip::Date object, these lines can be expressed equivalently as: $date = $obj->new(); $date = $obj->new(@opts); $date = $obj->new($string); $date = $obj->new($string,@opts); If @opts is passed in, new Date::Manip::Base and Date::Manip::TZ objects will be created with the configuration specified, so you should only do this if you explicitly want to work with multiple configurations. If you want to modify an existing configuration, you must use the config method described below. new_config $obj2 = $obj1->new_config(); $obj2 = $obj1->new_config($string); $obj2 = $obj1->new_config($string,@opts); $obj2 = $obj1->new_config(@opts); This creates a new instance with a new Date::Manip::Base object and a separate set of config options (even if no config options are included). new_date new_delta new_recur $date = $obj->new_date(); $date = $obj->new_date($string); $date = $obj->new_date($string,@opts); $date = $obj->new_date(@opts); These create a new instance of the specified object. In this case, $obj can be any of the Date::Manip classes, so a date can be created from a delta: $delta = new Date::Manip::Delta; $date = $delta->new_date(); OTHER METHODS
base $dmb = $obj->base(); This returns the Date::Manip::Base object associated with the given object. config $obj->config($var1,$val1,$var2,$val2,...); This will set the value of any configuration variables. Please refer to the Date::Manip::Config manual for a list of all configuration variables and their description. err $err = $obj->err(); This will return the full error message if the previous operation failed for any reason. $obj->err(1); will clear the error code. is_date is_delta is_recur $flag = $obj->is_date(); Returns 0 or 1, depending on the object. For example, a Date::Manip::Date object returns 1 with the is_date method, and 0 for the other two. tz $dmb = $obj->tz(); This returns the Date::Manip::TZ object associated with the given object. version $vers = $obj->version($flag); This returns the version of Date::Manip. If $flag is passed in, and $obj is not a Date::Manip::Base object, the version and timezone information will be passed back. KNOWN BUGS
None known. BUGS AND QUESTIONS
Please refer to the Date::Manip::Problems documentation for information on submitting bug reports or questions to the author. SEE ALSO
Date::Manip - main module documentation LICENSE
This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR
Sullivan Beck (sbeck@cpan.org) perl v5.12.1 2010-01-12 Date::Manip::Obj(3)
All times are GMT -4. The time now is 04:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy