Get-Content and add Date and Time in a new file

Hello,
in a existing file I have data like:
1;Idle
5;chrome
1;spoolsv
Now I need to grab the content and add date and time in front of each line and save it to another file like:
07.04.2015;10:18;1;Idle
07.04.2015;10:18;5;chrome
07.04.2015;10:18;1;spoolsv
But I don't have any idea how I could solve this challange. Does anyone have a helping hand for me?
Greetings

Hello,
If you need a new file with the desired output try this
get-content .\current.txt | Foreach-Object{ $dntv = (get-date) ; "$dntv" + $_} | Out-File newfile.txt
regards,
V
Venu

Similar Messages

  • I was using osx 10.5.8 and upgraded to mavericks 10.9.4,after when restoring all my data from time machine ,the new mavericks os was replaced by the old OS 10.5.8 any solution

    I was using osx 10.5.8 and upgraded to mavericks 10.9.4,after that ..when restoring all my data from time machine ,the new mavericks os was replaced by the old OS 10.5.8 ...any solution to get back to the upgraded mavericks OS????

    Hi, how did you get MavX from 10.5.8, since it requires 10.6.8 to get MavX from Apple's App Store?

  • How can I save my data and the date,the time into the same file when I run this VI at different times?

    I use a translation stage for the experiment.For each user in the lab the stage position (to start an experiment) is different.I defined one end of the stage as zero. I want to save the position , date and time of the stage with respect to zero.I want all these in one file, nd everytime I run it it should save to the same file, like this:
    2/12/03 16:04 13567
    2/13/03 10:15 35678
    So I will track the position from day to day.If naybody helps, I appreciate it.Thanks.

    evolution wrote in message news:<[email protected]>...
    > How can I save my data and the date,the time into the same file when
    > I run this VI at different times?
    >
    > I use a translation stage for the experiment.For each user in the lab
    > the stage position (to start an experiment) is different.I defined one
    > end of the stage as zero. I want to save the position , date and time
    > of the stage with respect to zero.I want all these in one file, nd
    > everytime I run it it should save to the same file, like this:
    > 2/12/03 16:04 13567
    > 2/13/03 10:15 35678
    >
    > So I will track the position from day to day.If naybody helps, I
    > appreciate it.Thanks.
    Hi,
    I know the function "write to spreadsheet file.vi"
    can append the data
    to file. You can use the "concatenate strings" to display the date,
    time as well as data... Hope this help.
    Regards,
    celery

  • HT5252 I tried to change my metadata date and got this   Aperture was not able to adjust the date and time of the original file "01769_p_h13ajyrm4bm0944.jpg" because it is locked or you do not have permission to modify it.

    I tried to change the metadata date.  It changed the date on my photo, but when I checked the box that said "also change my original file", it gave me this error message.
    Unable to change original file.  Aperture was not able to adjust the date and time of the original file “01769_p_h13ajyrm4bm0944.jpg” because it is locked or you do not have permission to modify it.
    Wassup?

    What is your Aperture version? The older versions of Aperture 3 had a problem to apply Metadata changes to the original file.
    If you are using the current version Aperture 3.4.5, try to repair the permissions on your Aperture library, if you have not already done so:
    Launch Aperture with the key combination ⌥⌘ held down and select "Repair Permissions" from the First Aid PAnel, that will appear.
    If that does not help, post back with more information on your original files - are the referenced or managed? Where is your Aperture library located? Since when do you have this problem? And what did you do directly before noticed the problem for the first time?
    Regards
    Léonie

  • Aperture was not able to adjust the date and time of the master file "2008-06-22 at 14-41-14.jpg" because it has a format that does not permit date modification.

    I can't seem to find a way to update the date/time of a master file. There is a format issue but I can't seem to figure out how to correct it.
    Aperture was not able to adjust the date and time of the master file “2008-06-22 at 14-41-14.jpg” because it has a format that does not permit date modification.

    Can you post an ipconfig /all from the server and the DC?
    Robert Pearman SBS MVP
    itauthority.co.uk |
    Title(Required)
    Facebook |
    Twitter |
    Linked in |
    Google+

  • How to read the date and time information of a file by labview

    how to read the date and time information of a file by labview? for example, created time and modified time.
    Solved!
    Go to Solution.

    if you need to know the last modification date of file:-
    "Functions->File I/O->Advanced File Functions->File/Directory Info.vi"
    This vi returns the value of file's last modification date. This is returned as U32 number. To see it in MM/DD/YY format you must create the indicator, right-click on it and select "Format & Precision" item from drop-down menu. Then select "Time and Date" format there.
    Thanks as kudos only

  • Can not set date and time on a new Apple TV

    can not set date and time in a new appletv

    Hello lfsalas55,
    You may need to verify that TCP port 123 on your router is open and available for use by your Apple TV.
    Apple TV: TCP and UDP ports and protocols used
    http://support.apple.com/kb/HT2463
    Cheers,
    Allen

  • Difference between the TABs  "All Content" and "Discussions" on the new forum?

    Hi,
    Does anyone know the difference between the TABs  "All Content" and "Discussions" on the new forum?  They seem to be the same.  I'm confused.
    Petey

    Petey,
    Though I was part of the forum update beta, there was some that we could not effectively test, plus some aspects (like "Like"), that some liked, but others did not. That sort of thing happens.
    Also, now that we have the full version, and all servers are synced, there will probably be things that the beta testers did not get to experience. We will all be learning, in the process too. Also remember, much of the new forum software was provided by Jive, and though many of us commented (pros and cons), only so much could be addressed. It was not quite like doing a beta on Adobe software, as there was a complete, separate layer in between.
    So far, what I see looks close to what we saw a few weeks (months?) ago. Now, I need to really put the real software through its paces, to see what got changed from then, until now.
    Good luck,
    Hunt

  • How do I move both my contents and playlists to my new computer?

    How do I move both my contents and playlists to my new computer?  I have tried the suggestions in previous posts of copying the library and music folders into the itunes folder on my new pc.  I don't have the option to file>library>import anything.  The only thing that transfers, even on home sharing is purchased music.  No music loaded from CD's and no playlists.

    Hello Kayaks2,
    Thanks for using Apple Support Communities.
    To answer your questions about moving your music to a new computer please look at the following support article.
    iTunes: How to move your music to a new computer
    http://support.apple.com/kb/HT4527
    Take care,
    Alex H.

  • Automator and applescript to copy new files in a folder with same name as parent folder

    I have an iMac with a pictures folder (Finder folder) containing several subfolders with pictures. As per now, all these subfolders are imported into an iPhoto library (and the structure of the Finder pictures folder is thus maintained: The iPhoto events are named the same as the Finder subfolder). I.e. I have not created any albums in iPhoto.
    I have also set up a workflow, where new iPhone photos are automatically being synced to specified Finder folders within the iMac pictures folder. So what I want to do is to make a workflow to import potential new photos from week to week into the existing iPhoto structure. I know iPhoto has this Autoimport folder, so this one is unpacked and "mapped". So, this is what I´m hoping to do:
    Automator (iCal - want to do this on a weekly basis):
    - Get specified Finder items -- set to target folder = iMac pictures folder
    - Get folder content (with subfolders)
    - Filter Finder items
         - Items from the last 7 days (which then would be any new files created last week)
    - Applescript/shell script loop(?)
         - Get folder name for each file´s (from previous step) parent folder
         - Create new folder with same name as the file´s parent folder (if not already existing) under the iPhoto Autoimport folder
         - Copy the given file into the folder from above
    - Run iPhoto application (Automator task), which then should just auto import the new photos according to the Finder folder structure
    Whith the workflow above, I aim to maintain the existing iPhoto structure, and just import new photos into the existing structure. Creating folder names under the Autoimport, similar as the existing Finder folder names / iPhoto events should make it possible to have the new files imported under the existing event, right?

    Anyone?
    I have now switched to Aperture (from iPhoto) due to Aperture´s capability to handle Finder folder structure, and due to the possibility of having the pictures within Aperture as referenced files to the pictures within the Finder folders (i.e. possibility to delete pictures from both library and Finder folder at the same time).
    So I have a superior Finder folder called "Album". Within "Album" I have several subfolders (sub albums) containing pictures. The "Album" folder with subfolders are imported into Aperture as "Projects and albums", and the pictures are uploaded within the Aperture structure as referenced files. So for now the Aperture structure is more or less a direct mirror of the Finder folder structure, whereas "Album" is the project.
    And this is my current workflow in Automator, but I´m searching help with my Applescript:
    - Get specified Finder items (target folder = the superior Finder folder "Album")
    - Get Folder content
    - Filter Finder items (to look for potential new files to import into Aperture)
         - Kind is not folder
         - Date created last X days
    The output files from this task enters an Applescript
    on run {input, parameters}
           repeat with f in input (**Loop**)
                   tell application "Finder"
                          set fileName to name of (f)
                          set parentFolder to name of container of (f)
                          tell application "Aperture"
                                 tell library 1
                                        tell project "Album"
                                               if (exists album parentFolder) then
                                                 ** I then would like to check if fileName already exist within the existing album**
                                                 ** If not existing, I would like to import file f into the existing album as a referenced file**              
                                               else if not (exists album parentFolder) then
                                                       make new album with properties {name:parentFolder}
                                                ** I then would like to import file f into the new album as a referenced file**
                                               end if
                                        end tell
                                 end tell
                          end tell
                   end tell
           end repeat
    end run

  • How do I get content from my old iPod Touch to my new iPhone 5?  My iPod Touch is too old to use iCloud

    How do I get content from my old iPod Touch to my new iPhone 5?  My iPod Touch is too old to use iCloud. I have activated the phone but am stick at the point of the set-up where my 3 choices are:
    1. Set up as new phone
    2.  Restore from icloud Backup
    3.  Restore from iTunes Backup
    thanks!

    If your iPod touch music is in your iTunes library, you just need to sync the new iPod nano with iTunes, the songs will be transfer to your new iPod. If not, you can follow this guide to transfer the songs from iPod touch to iTunes first, and then re-sync them to your new iPod. Hope it helps. Feel free to email me if you need further help.

  • When I minimize a window in INDD and then open a new file, my minimized window pops back up. How do I keep it minimized?

    When I minimize a window in INDD and then open a new file, my minimized window pops back up. How do I keep it minimized?

    amandaecarroll wrote:
    How do I keep it minimized?
    Actually, I suspect you can't. You get various behaviors based on a combination of settings in Preferences > Interface; namely Open Documents as Tabs and Enable Floating Document Window Docking; but it doesn't seem to make much sense as far as I can tell. Throw in the additional "application frame" wildcard on a Mac, and even just exploring the effects of the settings and drawing conclusions about them gets tricky. It sounds like you've got your windows floating, whereas I suspect many if not most users have opted for the more structured and seemingly more logical tabbed/docked method, in which case they haven't encountered your issue and don't really understand it. One might ask; if your new/current document is "in front" then what difference does it make if others behind it are minimized, maximized, or something in between?

  • Need a perl script which monitors a network folder and sends email when new files/folders arrived...

    I need a perl script (or something else better) which monitors a network folder and sends email when new files/folders arrived. I tried it in Automator but failed.
    Thanks!

    Yes. I tried it. But whenever I restart m Mac, the watch folder doesn't work until I reconnect to network or run the Automator... I need a simple system that automatically connects to the network and monitor the folder, even I restart the Mac.
    Thanks!

  • How to concatenate date and time after a logical file in application server

    Hi Experts ,
    I have a requirement that goes like this : I have a job that runs parallelly with 10 different variants at the same time. Each job will write the data into a file in the application server, since the jobs run parallelly there is a chance of the file being over-written and hence we have decided to concatenate time and date at the end of the file so that the file does not get over-written. Can someone please let me know how to incorporate this change.
    Thanks & Regards,
    Balaji.K

    Hi Balaji.
    Use CONCATENATE functionality.
    A sample code snippet for your reference :-
    CONCATENATE  p_path  text-202 c_9 p_name c_9  lv_fcount  c_9  lv_date
                                                 c_9 lv_time  INTO  gv_file.
    Regards
    Abhii

  • Date and Time in the flat file

    Hi All,
    I am trying to design a flow which will get data from a flat file. The file has a field which contains both the time and date. How can I handle this in BW? Do I need to creat 2 infoobjects and split the flat file field in start routine or transfer rule? Or is there any stadard infoobject which can hold both the data and time?
    Also, the client asked me if I want a .CSV file or .XLS file. Which one is better for uploading into BW? Any PROS and CONS?
    Best Regards,

    Hi,
    There is no single Data Type which accepts the Date and Time. Other way is to look the data as CHAR. Else the Update Routine/Formula is the Best
    In the Update Rule or Transfer Rule use the Formula
    Let the Info Objects be
    0date
    0Time
    The Transfer Rule/ Update Rule Formulas Be
    0Date --> LEFT( 8, 'DateTime' )
    0Time --> RIGHT(6, 'DateTime')
    Then CSV is the best Option to accept the Data as it is ready for Upload
    Regards
    Happy Tony

Maybe you are looking for