How can I apply 'date' command to specific columns, in a BASH script?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How can I apply 'date' command to specific columns, in a BASH script?
# 8  
Old 06-15-2018
If necessary, you can adapt above to your locale settings:

Code:
awk '
BEGIN   {"locale mon" | getline TMP
         for (i=split(TMP, MNUM, ";"); i; i--)  MON[MNUM[i]]=i
        }                          
'


Last edited by RudiC; 06-15-2018 at 04:34 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to apply functions to multiple columns dynamically

Hello, I have a requirement to apply hashing algorithm on flat file on one or more columns dynamically based on header sample input file ID|NAME|AGE|GENDER 10|ABC|30|M 20|DEF|20|F say if i want multiple columns based on the header example id,name or id,age or name,gender and hash and... (13 Replies)
Discussion started by: mkathi
13 Replies

2. Shell Programming and Scripting

Bash to select text and apply it to a selected file in bash

In the bash below I am asking the user for a panel and reading that into bed. Then asking the user for a file and reading that into file1.Is the grep in bold the correct way to apply the selected panel to the file? I am getting a syntax error. Thank you :) ... (4 Replies)
Discussion started by: cmccabe
4 Replies

3. Shell Programming and Scripting

Script to check for a specific number of columns in a file

Hi All I have a file which has five columns in each rows. cat file.txt a|b|c|d|e 1|2|3|4|5 a1|a2|a3|a4|a5 . . . I need to make sure that there are no less than five or more than five columns (in all the rows) by mistake. I tried this : cat file.txt | awk 'BEGIN{FS="|"};{print... (3 Replies)
Discussion started by: chatwithsaurav
3 Replies

4. Shell Programming and Scripting

Perl script to accept specific columns from excel

Hi All, I have below perl script which writes xml from .xls file. Now i want to add below two conditions in this script : 1. to check if the the input .xls file has ony two columns , if more tahn two columns then script should pop up an error. 2. If there are two columns , then first column... (4 Replies)
Discussion started by: omkar.jadhav
4 Replies

5. Shell Programming and Scripting

Read Two Columns - Apply Condition on Six other columns

Hello All, Here is my input univ1 chr1 100 200 - GeneA 500 1 0 0.1 0.2 0.3 0.4 0.5 univ1 chr1 100 200 - GeneA 600 1 0 0.0 0.0 0.0 0.0 0.1 univ1 chr1 100 200 - GeneA 700 1 0 0.4 0.4 ... (2 Replies)
Discussion started by: jacobs.smith
2 Replies

6. UNIX for Dummies Questions & Answers

Want to get list of Linux commands used on specific date through HISTORY command

I want to get list of linux commands used on Jan 01 2014 with the help of HISTORY command or some other linux commands,. Kindly help. (3 Replies)
Discussion started by: karthick nath
3 Replies

7. Shell Programming and Scripting

Need to view command in history for specific date

hi i want to find a command in history for specific date . is it possible that i can view ?? (1 Reply)
Discussion started by: scriptor
1 Replies

8. Shell Programming and Scripting

find command to filter specific type of files older than certain date.

Hi I need to find the list of files in a directory and to do some specific operations based on the type of files. suppose in a directory am having .dat , .log, .err, .rej file types. i need to filter out .dat and .log only which are older than six months. i used the below query but the... (2 Replies)
Discussion started by: msathees
2 Replies

9. Shell Programming and Scripting

script for get lines with specific date

I'm a newbie in AIX, i want to make a script for grep any lines with date bellow 20 PRINT0089-88615 data1 3072 Mon Dec 19 17:53:49 WITA 2011 PRINT0089-88616 data1 4096 Mon Dec 19 17:53:49 WITA 2011 PRINT0089-88618 data1 5120 Mon Dec 19... (7 Replies)
Discussion started by: michlix
7 Replies

10. Shell Programming and Scripting

Perl script to get info from specific rows & columns (.xls file)

Hi all, I want to read some specific rows & columns in the .xls file with my script to get the data to be manipulated. Now, I can read the .xls file correctly & i can go to the specific sheet that I want but i have a problem to specify the specific rows & columns. I mean, I want to get the info... (0 Replies)
Discussion started by: Yohannita
0 Replies
Login or Register to Ask a Question
tartdates(5)						      LinuxTaRT Special Dates						      tartdates(5)

NAME
tartdates - Special date configuration for LinuxTaRT DESCRIPTION
LinuxTaRT uses a configuration file called specialdates to enable the user to display a specific tagline on certain special dates. The name and location of this file is specified in the LinuxTaRT configuration file ~/.tartrc, but is usually: ~/.tartdates PARAMETERS
Each line of the special date file consists of a day of the year expressed as a two digit month, a forward-slash (/), a two digit date, a colon (:) and a line of text. mm/dd:tagline text Any line that does not conform to this specification will be treated as a comment. Comments may also be specified by prefixing text with a # symbol. Using this method, you can place a comment behind a date line. EXAMPLES
01/01:Happy New Year!! Will use "Happy New Year!!" as the tagline when the date is January 1st. 12/25:Merry Christmas to all! Displays "Merry Christmas to all!" as your tagline on Christmas day. FILES
~/.tartdates SEE ALSO
tart(1) tartrc(5) tart-custom(5) Mark Veinot 1.0.0 tartdates(5)