Sponsored Content
Top Forums Shell Programming and Scripting [Solved] Need help changing a field from MM/DD/YY to DD/MM/YY format Post 302692153 by Lem on Monday 27th of August 2012 07:58:37 AM
Old 08-27-2012
If all the records are like these, then:
Code:
$ cat file
"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. LTD"
$ sed 's|^"\([0-9]*\)/\([0-9]*\)/|"\2/\1/|' file
"16/11/09","ABC","        1","EU","520892414","1","600","31351000","1234567","ANR BANK CO. LTD"
"16/11/09","PQR","        2","EU","520892427","1","600","31351000","5467897","ANR BANK CO. LTD"

--
Bye
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

changing month in Mmm format to mm FORMAT

i have an variable mydate=2008Nov07 i want o/p as in variable mymonth=11 (i.e nov comes on 11 number month) i want some command to do this for any month without using any loop. plz help me (1 Reply)
Discussion started by: RahulJoshi
1 Replies

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

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

4. Shell Programming and Scripting

[Solved] Changing to upper case in csh

How can I change a string contained in a variable to upper case using csh ??? ---------- Post updated at 08:39 AM ---------- Previous update was at 08:29 AM ---------- I think I've got it, using tr has solved the problem set opt = ` echo $opt | tr "" "" ` (1 Reply)
Discussion started by: kristinu
1 Replies

5. Shell Programming and Scripting

[SOLVED] Changing file names

I have written a csh script that changes the name of file from src to dst. I am getting the error below: TESTAmvfiles DONE TESTAmvfiles set: Variable name must begin with a letter. The csh script is: #!/bin/csh #... (0 Replies)
Discussion started by: kristinu
0 Replies

6. Shell Programming and Scripting

[Solved] Changing 0 to 1 and 1 to 0

Hi I have an expression that returns 1 if a text is found and 0 if its not found. I need it the other way around. 0 of found and 1 if its not found echo $((`cat /var/log/system1/output.html | grep aligment | head -n1 | wc -l`)) Is this possible without doing an if/then/else, just... (5 Replies)
Discussion started by: Jotne
5 Replies

7. Shell Programming and Scripting

Changing field X in file

/etc/newsyslog.conf on a Mac OSX system contains: # configuration file for newsyslog # $FreeBSD: /repoman/r/ncvs/src/etc/newsyslog.conf,v 1.50 2005/03/02 00:40:55 brooks Exp $ # # Entries which do not specify the '/pid_file' field will cause the # syslogd process to be signalled when that... (3 Replies)
Discussion started by: jnojr
3 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. Solaris

[Solved] Question changing timezone rules / zic

Dear, One of our customer which is located in Iraq/Baghdad, has informed us about a official change in daylight saving time in few days later and has asked us to fix this issue. So, the current timezone of that system is set as 'Asia/Baghdad' which is correct. however to fix the issue I went... (0 Replies)
Discussion started by: Anti_Evil
0 Replies

10. UNIX for Advanced & Expert Users

Help changing date format in the nth field

Hi, I have two (2) things that I want to do. First is to change the date format that is in the nth field from MM/DD/YY to YY/MM/DD. Preferably, I wish I know how to make it a 4-digit year but I don't. Problem is I can only assume it is a 20 century Second is somehow know how to figure out... (1 Reply)
Discussion started by: newbie_01
1 Replies
MCE-INJECT(8)						  Linux's Administrator's Manual					     MCE-INJECT(8)

NAME
mce-inject - Inject machine checks into x86 kernel for testing SYNOPSIS
mce-inject mce-file1 ... mce-inject < mce-file DESCRIPTION
mce-inject allows to inject machine checks in a running x86 Linux kernel. machine checks are internal CPU errors. This tool is intended to test the machine check handling code. The injection only happens on the software level and does not simulate full machine check handling on the platform level. The machine checks to be injected are described in a input language similar to the format the kernel outputs on a panic message (with a few extension). In general you should be able to pipe in a panic message to inject that mce. See the IA32 SDM Vol3a chapter 14 for the details on fields. They correspond to the machine check MSRs of the standard IA32 Machine check architecture described there. INPUT LANGUAGE
These generally represent the similarly CPU MSRs, with some metadata on where to inject the exception. Please see the IA software develop- ers Manual for more details. The machine check always starts with MCE or CPU number|broadcast [bank-number] Machine check is injected on CPU xx or broadcasted to all CPUs BANK bank-number Machine check bank to inject on. STATUS {number|fatal|corrected|uncorrected|pcc|uc|val|en|over|ar|ucna|srao|srar|s} The symbols generally represent hardware register bits, as documented in the Intel software developer's manual. When multiple are listed they are ored together. MCGSTATUS {number|mcip|ripv|eipv} The symbols generally represent hardware register bits, as documented in the Intel software developer's manual. When multiple are listed they are ored together. ADDR number RIP number RIP number:<number>{string} RIP number:number MISC number CPU number : machine check exception : number BANK number : number parsed for compatibility with kernel output. Use explicit statements TSC number TSC state injected in machine check NOBROADCAST Don't broadcast exceptions to all CPUs. Default is to broadcast UC IRQBROADCAST Broadcast IRQ to all CPUs that not getting error injection. NMIBROADCAST Broadcast NMI to all CPUs that not getting error injection. IN_IRQ MCE should be injected in interrupt context IN_PROC MCE injected in process context. HOLD Don't inject MCE immediately but hold it for later injection. This is useful for testing injection on multiple CPUs in parallel SOCKETID number Socketid. Ignored by kernel on injection. MCGCAP number Machine check capabilities register value. Currently ignored by kernel on injection. POLL Inject in machine check poller code. EXCP Inject as machine check exception. APICID number APIC ID of CPU. Ignored by kernel on injection. A list of symbols ors the symbols together. Multiple fields can be on a line. number can be hex/octal/decimal in the usual C format. Multiple machine checks can be in a single file, each new one starts with "CPU" or "MCE". For all missing fields reasonable default values are filled in (hopefully) Comments start with # until the end of the line The keywords are case-insensitive. REQUIREMENTS
mce-inject to run as root. /dev/mcelog has to exist. The kernels needs to have machine check injection ( CONFIG_X86_MCE_INJECT ) enabled and if modular the mce-inject module loaded. This option is available in Linux 2.6.31 or later. NOTES
The mce-test package has a lot of input file examples. SEE ALSO
Intel 64 and IA32 Architectures Software Developer's manual, Volume 3, System programming guide Parts 1 and 2. Machine checks are described in Chapter 14 in Part1 and in Append ix E in Part2. Datasheet of your CPU. Intel OTC May 2009 MCE-INJECT(8)
All times are GMT -4. The time now is 11:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy