Sponsored Content
Top Forums Shell Programming and Scripting How to change date format in file Post 302360287 by condmaster on Thursday 8th of October 2009 01:43:27 PM
Old 10-08-2009
Power How to change date format in file

Hello!

I have a textfile that look like this:


Code:
"83d1:46:2b";"20091008190000";"Rögle BK - Skellefteå";"Swedish"
"d4c:46:21";"20091008190000";"Södertälje - Brynäs";"Swedish"
"d4b:46:2";"20091008190000";"HV 71 - Färjestad";"Swedish"
"838:46:b";"20091010160000";"Skellefteå - HV 71";"Swedish"
"a119:46:2b";"20091010160000";"Modo - Rögle BK";"Swedish"
"83d:46:2b";"20091010160000";"Timrå - Linköping";"Swedish"
etc
etc

And i want to change the date to epoch format, eg:

Code:
"838:46:2b";"1255021200";"Luleå - Djurgården";"Swedish"
"1139:46:2b";"1255021200";"Timrå - Modo";"Swedish"
"83d:46:2b";"1255021200";"Rögle BK - Skellefteå";"Swedish"
"d4c:46:2";"1255021200";"Södertälje - Brynäs";"Swedish"
"d4b:46:21";"1255021200";"HV 71 - Färjestad";"Swedish"
"838:46:b";"1255183200";"Skellefteå - HV 71";"Swedish"
"81b:46:2b";"1255183200";"Modo - Rögle BK";"Swedish" 
etc
etc

The system is SLES 11 x86

Is there an easy way to do this with a script?

Thanks in advice

Last edited by Franklin52; 10-08-2009 at 03:55 PM.. Reason: Please use code tags!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to change it to the date format

Hi, I want to know how to change this string to date format 20061102122042 to 02-11-2006 12:20:42 or 02-Nov-2006 12:20:42 Please let me know at the earliest.Thanks in advance. Regards, Preetham R. (3 Replies)
Discussion started by: preethgideon
3 Replies

2. Shell Programming and Scripting

script to change the date format in a file

i have many files with date format of 6-9-2008 and i want a script that can change the format to 2008-06-09 Thanks (15 Replies)
Discussion started by: shehzad_m
15 Replies

3. Shell Programming and Scripting

convert date format to mysql date format in log file

I have a comma delimited log file which has the date as MM/DD/YY in the 2nd column, and HH:MM:SS in the 3rd column. I need to change the date format to YYYY-MM-DD and merge it with the the time HH:MM:SS. How will I got about this? Sample input 02/27/09,23:52:31 02/27/09,23:52:52... (3 Replies)
Discussion started by: hazno
3 Replies

4. Shell Programming and Scripting

Date format change

Dear Friends, Need your help once again, I have a variable ( e.g. ${i}) whoch has date in MM/DD/YYYY (E.g. 12/31/2011) format. I want to change it to DD/MM/YYYY (e.g. 31/12/2011) format. Request you to guide me as we are unable to do the same. Thanks in advance Anu. (1 Reply)
Discussion started by: anushree.a
1 Replies

5. Shell Programming and Scripting

File date format how to change

Hi All, Below are the unix files taken by the help of ls -lrt -rw-r--r-- 1 kbehera Domain Users 293 Jul 27 13:33 sand.txt -rw-r--r-- 1 kbehera Domain Users 4 Jul 27 13:37 sand1.txt -rw-r--r-- 1 kbehera Domain Users 293 Jul 27 15:30 new_sand.txt -rw-r--r-- 1 kbehera Domain Users 0 Jul 27... (2 Replies)
Discussion started by: krupasindhu18
2 Replies

6. Shell Programming and Scripting

How to change the format of the date column in a flat file?

Hi, i have a flat file namely temp.txt with this data below ID|name|contact_date 101|Kay|2013-12-26 102|let|2013-12-26 I need to modify the date data in the flat file into MM/DD/YYYY HH24:MI:SS format let me know the code for this. Thank you! (5 Replies)
Discussion started by: srikanth_sagi
5 Replies

7. Shell Programming and Scripting

Date format change in UNIX .dat file

Hi, I need help to convert the date format in .DAT file in unix. I want to convert 10@@|SWIFT MT568 Extract@@|Apr 14 2014 5:47:52:563PM@@|Apr 14 2014 4:33:47:663PM@@||##| into 10@@|SWIFT MT568 Extract@@|04/14/2014/ 5:47:52:563PM@@|04/14/2014 4:33:47:663PM@@||##| Appreciate... (18 Replies)
Discussion started by: karthikengox
18 Replies

8. Shell Programming and Scripting

Need to change date format in a csv file using awk

Example: Input csv file 00245DLS,Sitel Ocala,12/31/2014,18:45,1.00,7.00,0.00,0.00 00245DLS,Sitel Ocala,12/31/2014,19:00,-1.00,-1.00,-1.00,-1.00 00245HB,Charlotte,01/01/2015,00:00,-1.00,-1.00,-1.00,0.00 Output csv file 00245DLS,Sitel Ocala,2014/12/31,18:45,1.00,7.00,0.00,0.00 00245DLS,Sitel... (8 Replies)
Discussion started by: adit
8 Replies

9. Shell Programming and Scripting

Date format change in a csv file

Hi, We have csv file where date is coming in MM/DD/YYYY HH:MM:SS (06/23/2015 20:59:12) in multiple places But we need to change the date format to DD/Mon/YYYY HH:MM:SS (23/Jul/2015 20:59:12) using shell script. Please let us know how can we achieve the same. (16 Replies)
Discussion started by: dholea
16 Replies

10. UNIX for Beginners Questions & Answers

Change date format in a file.

Hi all, I have a file as below, i would like the change the format of the time from "11/7/2019 20:12" to "2019-07-11 20:12:00" in the last coloumn. any awk solution on this. Input: 2,0,695016,1961612,497212,5800804,0,0,161,33,7605,12226,23,10,66,0,0,34,11/7/2019 20:10... (4 Replies)
Discussion started by: Raghuram717
4 Replies
Swedish(5)							File Formats Manual							Swedish(5)

NAME
Swedish, swedish - Introduction to Swedish language support DESCRIPTION
This reference page describes the coded character set (codeset), locale, device, and other kinds of support for the Swedish language. Codesets The operating system supports the following codesets for Swedish by means of locales, codeset converters, or both: ISO 8859-1 (ISO Latin-1) ISO8859-1 is the string that represents this codeset in the names of locales and codeset converters. See iso8859-1(5) for more information. ISO 8859-15 (ISO Latin-9) ISO8859-15 is the string that represents this codeset in the names of locales and codeset converters. See iso8859-15(5) for more information. UCS-2, UCS-4, and UTF-8 UCS-2, UCS-4, and UTF-8 are the strings that represent these encoding formats in the names of locales and codeset converters. See Unicode(5) for more information. PC code pages cp437, cp850, cp865, and cp1252 are the strings that represent these encoding formats in the names of codeset converters. See code_page(5) for more information. See the i18n_intro(5) and l10n_intro(5) reference pages for introductory information on codesets. The iconv_intro(5) reference page dis- cusses codeset converters and how to use them. Locales The operating system supports the following Swedish locales: sv_SE.ISO8859-1, sv_SE.ISO8859-15, and sv_SE.UTF-8, for Sweden Of these locales, only sv_SE.ISO8859-15 and sv_SE.UTF-8 support the euro currency sign. You can use the locale command (see locale(1)) to find out which locales are installed on your system. See i18n_intro(5) for information on setting locale from the operating system command line. For the Common Desktop Environment (CDE), you set locale by setting the session language. To do this, use the Language menu accessed from the Options button of the Login window. Keyboards The operating system supports the following VT style and PC style keyboards with Swedish characters printed on the keys: ---------------------------------------------- VT Style (105/108 keys) PC Style (102 keys) ---------------------------------------------- LK201-LM LK442-RA LK201-NM LK444-AM LK401-AM LK471-AF LK411-AM LK47W-AF LK450-AM LK97W-AF LK451-AM PCXAL-AM LK461-AM PCXAL-CA LK46W-AM PCXAL-JA PCXAL-MA ---------------------------------------------- For your keyboard to function correctly with your system, you must load a keyboard mapping table (keymap) that is appropriate for your key- board's model and language. If you load a keymap that does not correspond to your keyboard's model and language, your keyboard behavior is unpredictable. The label located on the bottom surface of a keyboard usually specifies its model (five letter code) and language (two let- ter code). See the keyboard(5) reference page for general information on keymaps and instructions for loading them in different formats. The following tables supply Swedish-specific information that you need when loading keymaps. Selecting keymaps in xkb format: --------------------------------------------------------- For VT Style For PC Style Keyboard: Select: Keyboard: Select: --------------------------------------------------------- LK201-LM lk201 LK442-RA lk442 or lk44x LK201-NM lk201 LK444-AM lk444 or lk44x LK401-AM lk401 LK471-AF lk471af or lk471 LK411-AM lk411 LK47W-AF lk471af or lk471 LK450-AM lk450 LK97W-AF lk97waf or lk97w LK451-AM lk450 PCXAL-AM pcxalja LK461-AM lk461 PCXAL-CA pcxalca LK46W-AM lk461 PCXAL-JA pcxalja PCXAL-MA pcxalma --------------------------------------------------------- Selecting keymaps in xmodmap format: ---------------------------------------------------------------------- For VT Style For PC Style Keyboard: Select: Keyboard: Select: ---------------------------------------------------------------------- LK201-LM swedish lk201lm dp LK442-RA swedish lk444ma or finnish lk444ca swedish lk201lm tw LK444-AM swedish lk444ma or finnish lk444ca LK201-NM swedish lk201nm dp LK471-AF swedish pcxalja swedish lk201nm tw LK47W-AF swedish pcxalja LK401-AM swedish lk401am dp PCXAL-AM swedish pcxalja swedish lk401am tw PCXAL-CA swedish pcxalja LK411-AM swedish lk411am PCXAL-JA swedish pcxalja LK450-AM swedish lk411am PCXAL-MA swedish pcxalja LK451-AM swedish lk411am LK461-AM swedish lk411am LK46W-AM swedish lk411am ---------------------------------------------------------------------- Keyboards can have keys with characters printed on both the left and right half of the keycap. The way you set or use your keyboard to send different sets of characters varies from one keyboard model to another. Furthermore, your keyboard allows you to enter more characters than those printed on the keycaps. Refer to the keyboard(5) reference page for information on how to enter characters. Printers PostScript fonts for languages supported by the ISO 8859-1 codeset are printer resident. SEE ALSO
Commands: locale(1) Others: code_page(5), euro(5), i18n_intro(5), i18n_printing(5), iconv_intro(5), iso8859-1(5), iso8859-15(5), keyboard(5), l10n_intro(5), Unicode(5) Writing Software for the International Market Swedish(5)
All times are GMT -4. The time now is 05:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy