Sponsored Content
Top Forums UNIX for Advanced & Expert Users Help changing date format in the nth field Post 302999312 by RudiC on Friday 16th of June 2017 04:57:50 PM
Old 06-16-2017
Try
Code:
awk '{split ($8, T, "/"); $8=T[3] "/" T[1] "/" T[2]} 1' file2
Objects in the image backed up on 15/04/21 00:30:18 for filespace /test_vol_abcd in node BOS123456:
Objects in the image backed up on 15/05/21 00:30:14 for filespace /test_vol_abcd in node BOS123456:

Bonus question: You can't. How would you tell month from day in 11/10/17?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing the date format

Hi, I know there is a Q/A section and lots of posts regarding date command here. I am sorry to start a new thread. I am very new to shell scripting (actually i am working on my first program), so please forgive my ignorance. I could not find an answer to my problem else where so i posted it... (10 Replies)
Discussion started by: Dream86
10 Replies

2. UNIX for Dummies Questions & Answers

Changing the format of date

Hi, There are lots of threads about how to manipulate the date using date +%m %....... But how can I change the default format of the commad date? $ date Mon Apr 10 10:57:15 BST 2006 This would be on fedora and SunOs. Cheers, Neil (4 Replies)
Discussion started by: nhatch
4 Replies

3. Shell Programming and Scripting

Changing date format

Hi, I have a column in a table of Timestamp datatype. For Example : Var1 is the column 2008-06-26-10.10.30.2006. I have Given query as date(var1) and time (var1) I got the file as in the below format : File1: Col1 Col2 2008-06-02|12.36.06 2008-06-01|23.36.35 But the problem is... (7 Replies)
Discussion started by: manneni prakash
7 Replies

4. UNIX for Dummies Questions & Answers

Changing from Excel date format to MySQL date format

I have a list of dates in the following format: mm/dd/yyyy and want to change these to the MySQL standard format: yyyy-mm-dd. The dates in the original file may or may not be zero padded, so April is sometimes "04" and other times simply "4". This is what I use to change the format: sed -i '' -e... (2 Replies)
Discussion started by: figaro
2 Replies

5. Shell Programming and Scripting

how I can add a constant to a field without changing the file format

Hi, I need to edit a file Protein Data Bank (pdb) and then open that file with the program VMD but when I edit the file with awk, it changes pdb format and the VMD program can not read it. I need to subtract 34 to field 6 ($ 6). this is a pdb file : ATOM 918 N GLY B 103 -11.855 8.675... (8 Replies)
Discussion started by: bio_
8 Replies

6. UNIX for Advanced & Expert Users

Changing the date format

Hi All, I am new to this forum, could any one help me out in resolving the below issue. Input of the flat file contains several lines of text for example find below: 5022090,2,4,7154,88,,,,,4/1/2011 0:00,Z,L,2 5022090,3,1,6648,88,,,,,4/1/2011 0:00,Z,,1 5022090,4,1,6648,88,,,,,4/1/2011... (0 Replies)
Discussion started by: av_sagar
0 Replies

7. Shell Programming and Scripting

Changing the date format

Hi all, I have a file with below data af23b|11-FEB-12|acc7 ad23b|12-JAN-12|acc4 as23b|15-DEC-11|acc5 z123b|18-FEB-12|acc1 I need the output as below:-(date in yyyymmdd format) af23b|20120211|acc7 ad23b|20120112|acc4 as23b|20111215|acc5 z123b|20120218|acc1 Please help me on this.... (7 Replies)
Discussion started by: gani_85
7 Replies

8. Shell Programming and Scripting

[Solved] Need help changing a field from MM/DD/YY to DD/MM/YY format

Hi, I need help changing a field from MM/DD/YY to DD/MM/YY format. Suppose a file a.csv. The record is "11/16/09","ABC"," 1","EU","520892414","1","600","31351000","1234567","ANR BANK CO. LTD" "11/16/09","PQR"," 2","EU","520892427","1","600","31351000","5467897","ANR BANK CO.... (4 Replies)
Discussion started by: Gangadhar Reddy
4 Replies

9. Shell Programming and Scripting

Changing date format

how do i change the following to show me what the date was 7 days ago? date +%Y-%m-%d (1 Reply)
Discussion started by: SkySmart
1 Replies

10. 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
XML::DOM::NamedNodeMap(3pm)				User Contributed Perl Documentation			       XML::DOM::NamedNodeMap(3pm)

NAME
XML::DOM::NamedNodeMap - A hash table interface for XML::DOM DESCRIPTION
Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can be accessed by name. Note that NamedNodeMap does not inherit from NodeList; NamedNodeMaps are not maintained in any particular order. Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a NamedNodeMap, and does not imply that the DOM specifies an order to these Nodes. Note that in this implementation, the objects added to a NamedNodeMap are kept in order. METHODS getNamedItem (name) Retrieves a node specified by name. Return Value: A Node (of any type) with the specified name, or undef if the specified name did not identify any node in the map. setNamedItem (arg) Adds a node using its nodeName attribute. As the nodeName attribute is used to derive the name which the node must be stored under, multiple nodes of certain types (those that have a "special" string value) cannot be stored as the names would clash. This is seen as preferable to allowing nodes to be aliased. Parameters: arg A node to store in a named node map. The node will later be accessible using the value of the nodeName attribute of the node. If a node with that name is already present in the map, it is replaced by the new one. Return Value: If the new Node replaces an existing node with the same name the previously existing Node is returned, otherwise undef is returned. DOMExceptions: * WRONG_DOCUMENT_ERR Raised if arg was created from a different document than the one that created the NamedNodeMap. * NO_MODIFICATION_ALLOWED_ERR Raised if this NamedNodeMap is readonly. * INUSE_ATTRIBUTE_ERR Raised if arg is an Attr that is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements. removeNamedItem (name) Removes a node specified by name. If the removed node is an Attr with a default value it is immediately replaced. Return Value: The node removed from the map or undef if no node with such a name exists. DOMException: * NOT_FOUND_ERR Raised if there is no node named name in the map. item (index) Returns the indexth item in the map. If index is greater than or equal to the number of nodes in the map, this returns undef. Return Value: The node at the indexth position in the NamedNodeMap, or undef if that is not a valid index. getLength Returns the number of nodes in the map. The range of valid child node indices is 0 to length-1 inclusive. Additional methods not in the DOM Spec getValues Returns a NodeList with the nodes contained in the NamedNodeMap. The NodeList is "live", in that it reflects changes made to the NamedNodeMap. When this method is called in a list context, it returns a regular perl list containing the values. Note that this list is not "live". E.g. @list = $map->getValues; # returns a perl list $nodelist = $map->getValues; # returns a NodeList (object ref.) for my $val ($map->getValues) # iterate over the values getChildIndex (node) Returns the index of the node in the NodeList as returned by getValues, or -1 if the node is not in the NamedNodeMap. dispose Removes all circular references in this NamedNodeMap and its descendants so the objects can be claimed for garbage collection. The objects should not be used afterwards. perl v5.8.8 2008-02-03 XML::DOM::NamedNodeMap(3pm)
All times are GMT -4. The time now is 07:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy