![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help in adding positive & negative values in a column | berlin_germany | Shell Programming and Scripting | 4 | 02-09-2007 01:03 PM |
| FILE:Adding new column | sandeep_hi | Shell Programming and Scripting | 2 | 06-09-2006 06:46 AM |
| Adding a column of numbers | Khoomfire | UNIX for Advanced & Expert Users | 1 | 01-18-2006 12:55 AM |
| adding a column at the end of the record | pavan_test | UNIX for Dummies Questions & Answers | 2 | 11-07-2005 07:39 AM |
| Changing the column for a row in a text file and adding another row | aYankeeFan | Shell Programming and Scripting | 9 | 05-02-2005 06:42 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Adding a date as a first column
I want to add a date to a record which is appended to a file that gets its data from an external source. An explanation:
1. Getting external data: curl http://www.example.com/temperatures.txt 2. Getting the required record: | grep mylocation 3. Appending to file: >> mytemperatures.txt The question is not only to append the temperatures, but to add a column with the current date and time. So I need to add something like "$( date +%Y%m%d%H%M%S )" as the first column to mytemperatures.txt. How is this done? Thanks in advance |
| Forum Sponsor | ||
|
|
|
|||
|
(echo -n `curl http://www.example.com/temperatures.txt | grep mylocation` ; date +param) >> mytemperatures.txt
|
| Thread Tools | |
| Display Modes | |
|
|