Search Results

Search: Posts Made By: jurgen
3,138
Posted By Klashxx
A slight variation: echo...
A slight variation:
echo "2011-12-31T13:00:09Z"|sed -e "s_\([0-9]\{4\}\)-\([0-9]\{2\}\)-\([0-9]\{2\}\).\([0-9:]\{1,\}\).*_\3/\2/\1 \4_g"
31/12/2011 13:00:09
3,138
Posted By Skrynesaver
Ugly as sin, but effective echo...
Ugly as sin, but effective

echo "2011-12-31T13:00:09Z"|sed 's/\([0-9]\{4\}\)-\([0-9]\{2\}\)-\([0-9]\{2\}\)T\([0-9]\{2\}\):\([0-9]\{2\}\):\([0-9]\{2\}\)Z/\3\/\2\/\1 \4:\5:\6/'
1,599
Posted By in2nix4life
This way works using the Korn shell: for...
This way works using the Korn shell:


for i in *-DATE*;do mv $i $(echo $i | sed 's/\-DATE//');done
1,206
Posted By mirni
If you use -e only, it is going to print the...
If you use -e only, it is going to print the output on stdout, but will not change updated_list. If you use '-e -i', it's gonna do editing-in-place and print nothing to the screen, bot modify the...
1,853
Posted By pravin27
Below code will take backup of inputfile as...
Below code will take backup of inputfile as inputfile.old before processing and then modify the inputfile
perl -p -i.old -nle 's/\/(\w+)(\d{8})/\/\2\/\1\2/' inputfile
2,471
Posted By birei
Hi, Here a solution using 'perl'. The code...
Hi,

Here a solution using 'perl'. The code uses the 'DateTime' module. Perhaps you need to install it from CPAN.

I suppose date is in format: YYYY MM DD. Tell me if I'm wrong because otherwise...
2,471
Posted By Corona688
Please post an actual sample of your input and...
Please post an actual sample of your input and the requested output data. From the looks of your code it's not quite as described.
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 03:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy