Are there any GAWK/TCSH guru's about that can give me a hand with this?
Imagine an ASCII format file with 5 columns of data:
I'm trying to change the date format in the last column such that 10-Aug-2015 is represented as 20150810. On a TCSH command line, I can do this by using the date command as follows:
The problem is I have several hundred files and each can have up to 100,000 lines. Thus, I need a mechanism to parse column 5 through the date command, such that each instance of the date is formatted as described. I only have the TCSH and GAWK (at a push SED) tools available to solve this, so my plan was to write a TCSH script referencing GAWK to do this.
I have tried piping the date command through a gawk print statement, but I can't quite work out how to read $5 into the date command. I'd had a look on several UNIX sites, but have yet to find a solution.
Can anyone help?
Thanks.
Imagine an ASCII format file with 5 columns of data:
Code:
ID,X,Y,Z,Date
1,10,10,4,3-Aug-2014
2,10,5,5,1,10-Aug-2015
.
.
.
.
I'm trying to change the date format in the last column such that 10-Aug-2015 is represented as 20150810. On a TCSH command line, I can do this by using the date command as follows:
Code:
date -d "10-Aug-2015" +%Y%m%d
The problem is I have several hundred files and each can have up to 100,000 lines. Thus, I need a mechanism to parse column 5 through the date command, such that each instance of the date is formatted as described. I only have the TCSH and GAWK (at a push SED) tools available to solve this, so my plan was to write a TCSH script referencing GAWK to do this.
I have tried piping the date command through a gawk print statement, but I can't quite work out how to read $5 into the date command. I'd had a look on several UNIX sites, but have yet to find a solution.
Can anyone help?
Thanks.
My Computer
- Computer type
- PC/Desktop
- Computer Manufacturer/Model Number
- Golden Mk. I.4
- OS
- Windows 10 Pro x64 ; Xubuntu x64
- CPU
- Intel i7 860 @ 2.80 GHz O/C'ed to 4.0GHz
- Motherboard
- Gigabyte P55A-UD3R Rev.1. Award BIOS F13
- Memory
- 16GB Corsair Vengance DDR3 @ 661 MHz Dual Channel (9-9-9-24)
- Graphics Card(s)
- EVGA NVidia GTX 560 1024MB
- Sound Card
- Realtek Integrated
- Monitor(s) Displays
- Dual Samsung SyncMaster 2494HS
- Screen Resolution
- 1920*1080 and 1920*1080
- Hard Drives
- 1*Samsung 840 EVO 120GB SSD;
1*OCZ Vertex 2 60GB SSD;
2*Samsung F3 SpinPoint 1TB in RAID0;
1*Samsung F1 SpinPoint 1TB;
2*Western Digital 1TB External USB 3.0
1*Western Digital 500GB External USB 3.0
1*Seagate 500GB External USB 2.0
- PSU
- Thermaltake ToughPower QFan 750W
- Case
- Thermaltake Element S VK60001W2Z
- Cooling
- Corsair H60 Water Cooling, 2*230mm and 2*80mm case fans
- Keyboard
- Logitech G110
- Mouse
- Logitech MX518