Results 1 to 3 of 3

Thread: 1- combine log files 2- convert them into a csv format

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default 1- combine log files 2- convert them into a csv format

    Hi all,

    each night the server starts backing up the users data and creates diff .log files.

    example)
    sync of XXXX:/export/home/user1 to /sync/syncvol08/user1
    sync of YYYY:/export/home/user2 to /sync/syncvol08/user2
    and etc. but they are for the same date.

    1- I want to combine all diff log files. I mean better in a way that the system merge all this type of log files chronically.
    2- I need to convert that .log file to a CSV(or excel) file which contains:

    Date-path from-path to-duration of synchronization

    * by duration of synchronizarion: means the diff. between starting now and successful and other lines are NOT needed.
    * other log files have exacty the same format

    for me it is really difficult to write a script which does both.

    Can anyone help with a solution?

    I would really appreciate it.

    Thanks in advance.
    Attached Files Attached Files
    Last edited by frhling; 18th November 2012 at 11:28 PM.

  2. #2
    Member billconner's Avatar
    Join Date
    Jul 2010
    Posts
    90
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Rep Power
    5

    Default

    First concatenate the files: cat file-1 >> file-2
    now run sed on the file-2 to create CSV:
    sed "s/current-delimter/,/g" >file-3
    file-3 will have the original files in CSV format

    Bill

  3. #3
    Junior Member
    Join Date
    Nov 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    Thanks for your comment and suggestion.

    Quote Originally Posted by billconner View Post
    First concatenate the files: cat file-1 >> file-2
    now run sed on the file-2 to create CSV:
    sed "s/current-delimter/,/g" >file-3
    file-3 will have the original files in CSV format
    Yes, but at the end all are in 1 Cell....

    Bill

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Shell Script to download files in different format
    By fluidjeel in forum Shell scripting
    Replies: 1
    Last Post: 6th February 2012, 06:29 AM
  2. Script to combine contents of files
    By linuxgeek in forum Shell scripting
    Replies: 2
    Last Post: 14th April 2011, 05:57 PM
  3. how to convert files view
    By linux12 in forum Web servers
    Replies: 1
    Last Post: 21st February 2011, 08:12 AM
  4. Convert Windows DOS file to Linux file format
    By chiku in forum Linux software
    Replies: 1
    Last Post: 1st October 2009, 04:33 PM
  5. Replies: 0
    Last Post: 5th June 2007, 04:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •