Do these date and time stamps appear on lines by themselves? Or at the start of lines? Or at a fixed location other than the start of a line? If not, how can the date and time stamps be uniquely identified as distinct from other text that might appear in your data?
Is this data contained in a text file? What is the format of data in your input file other than the date and time strings?
Is this a stand-alone project, or is other processing going to be done to your data at the same time? If other processing is being done, what tools are being used to do the other processing?
Your sample data and the format you showed us for your sample data is inconsistent. Is there one space between the day and the year as shown in:
Or are there two spaces as shown in:
?
Data is availble in .txt files, using .txt files to load data into database.
when data loading into Database, we are cnverting date and time formats using Datbase functions.
It 's taking long time to convert date and time to Datatbase default fomat.
so we are planing to convert the data in file level then load data into Database.
Have space between Day and year.
Data in files:
File1 :
File 2":
Moderator's Comments:
Please wrap all code, files, input & output/errors in CODE tags.
It makes them easier to read and preserves multiple spaces, wich can be critical for fixed width data.
Last edited by rbatte1; 05-11-2015 at 10:35 AM..
Reason: Added CODE tags and moderator comment.
The following script seems to work with the two file formats you gave as samples. This was tested using the Korn shell, but it should work with any shell that recognizes basic Bourne shell syntax:
Save the above code in a file (I used tester) for this example and make it executable:
I strongly encourage you not to include spaces and quotes in your filenames. But, with the sample files you specified, the following commands seem to convert your files as requested:
produces the output:
And, the command:
produces the output:
Dear friends,
i am having some Problems with a Sco Openserver in a Box (normally on VMWare, importing it on a Virtualbox does the same).
When i boot up the system on xx/09/2015 i got fork failed - too many processes during startup.
The programs which should run on the server, do not run.
I... (67 Replies)
I hear the Leap second for 2015 will occur on June 30 at 23:59:60 according to the wild rumours from internet the expected impact ranges from crashing to hanging servers.
Can anybody share their preparations what they have done for solaris servers? are there any patches to install or workaround?... (1 Reply)
How to convert date format such as 7/18/2015 to the number of month from requesting date 'date' in sh scripting ?
Let say I have output in my log.txt -> 7/18/2015. How I convert it to the full number of month starting from 'date' till 7/18/2015 in shell scripting ? Thanks in advance. (1 Reply)
I have the following perl one-liner to get yesterday's date, but I would like it in the form of dd-MMM-yy (for example: 01-JAN-12). Can someone alter the below code so I get the format I want? Also, could someone also give me a line for dd-Mmm-yy (for example 01-Jan-12)?
Code:
YEST=`perl -w... (3 Replies)