Sponsored Content
Top Forums Shell Programming and Scripting replacing one filed at run time in UNix Post 302072861 by matrixmadhan on Monday 8th of May 2006 10:03:35 AM
Old 05-08-2006
what have you tried so far ? Smilie Smilie Smilie

try this,

Quote:
awk -F"," '{ print "new,", $2,",",$3,",", $4,","}' samplefile
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed - Replacing all date & time occurrences in a file with a string using Sed

Hi, I am new to using Sed. I have a file containg lines like the following: INFORM----Test.pc:168:10/11/05 12:34:26 > some text goes here.. TRACE-----Test.pc:197:10/11/05 12:34:26 > some text goes here.. My requirement is to replace 10/11/05 12:34:26 with a string <RUNDATE> (including <... (4 Replies)
Discussion started by: Hema_M
4 Replies

2. UNIX for Advanced & Expert Users

How To Provide Time Sync Using Nts-150 Time Server On Unix Network?

can anybody tel lme,how to instal NTS -150 on a unix network,it needs some patch to fetch time frm serve,,?? (2 Replies)
Discussion started by: pesty
2 Replies

3. Shell Programming and Scripting

How to get time duration between two human readable time stamp in Unix?

Here is two time I have: Jul 12 16:02:01 Jul 13 01:02:01 and how can I do a simple match to get difference between two time which is 09:00:00 Thanks in advance. (3 Replies)
Discussion started by: ford99
3 Replies

4. UNIX for Dummies Questions & Answers

Converting string date time to unix time in AWK

I'd like to convert a date string in the form of sun aug 19 09:03:10 EDT 2012, to unixtime timestamp using awk. I tried This is how each line of the file looks like, different date and time in this format Sun Aug 19 08:33:45 EDT 2012, user1(108.6.217.236) all: test on the 17th ... (2 Replies)
Discussion started by: bkkid
2 Replies

5. Shell Programming and Scripting

Adding time to date time in UNIX shell scipting

I needed some help in adding a duration (in seconds) to a start time (in hhmmss format) and a start date (in mmddyy format) in order to get an end date and end time. The concept of a leap year is also to be considered while incrementing the day. The code/ function that I have formed so far is as... (3 Replies)
Discussion started by: codehelp04
3 Replies

6. Shell Programming and Scripting

Convert UTC time into current UNIX sever time zone

Hi guys thanks for the help for my previous posts.Now i have a requirement that i download a XMl file which has UTC time stamp.I need to convert UTC time into Unix server timezone. For ex if the time zone of unix server is CDT then i need to convert into CDT.whatever may be the system time... (5 Replies)
Discussion started by: mohanalakshmi
5 Replies

7. Shell Programming and Scripting

Replacing first field of file2 with the second filed of file1 for matching cases

Dear All, Need your help..:D I am not regular on shell scripts..:( I have 2 files.. Content of file1 cellRef 4};"4038_2_MTNL_KALAMBOLI" cellRef 1020};"4112_3_RAINBOW_BLDG" cellRef 134};"4049_2_TATA_HOSPITAL" cellRef 1003};"4242_3_HITESH_CONSTRUCTION" cellRef... (6 Replies)
Discussion started by: ailnilanjan
6 Replies

8. Programming

Arduino UNIX Time - Syncing Computer UNIX Time to Arduino Time with Python

Just finished a quick Python script to send the current unix time over to the Arduino from macOS, so in the absence of GPS or some other way to get the unix timestamp (epoch time) to the Arduino, I can get my macOS and Arduino UNO synced to within a second. Normally, when the Arduino starts... (9 Replies)
Discussion started by: Neo
9 Replies
UNBLOCK_DEM(1)						      General Commands Manual						    UNBLOCK_DEM(1)

NAME
unblock_dem - Insert linefeeds into a Digital Elevation Model (DEM) file SYNOPSIS
unblock_dem [-L] DESCRIPTION
The drawmap program processes USGS Digital Elevation Model (DEM) files (along with other types of files) to produce customized maps. Drawmap is able to read these files in their native format. However, since the files usually don't contain any linefeeds, they are diffi- cult for a human to read. Unblock_dem filters a DEM file and inserts linefeeds for human readability. It takes input from the standard input and writes to the standard output. The input data must be in uncompressed form, not in gzip-compressed form. Also, unblock_dem does not work with SDTS DEM files or GTOPO30 files. Unblock_dem normally takes no options, but, if you use the "-L" option, the program will print out some license information and exit. Some DEM files already have embedded linefeeds. Unblock_dem makes a feeble attempt to detect these files and abort. If the detection fails, the results are likely to be garbled, so it is wise to check the format of each file first. The drawmap program, with the "-i" option, will attempt to tell you whether a file contains linefeeds or not. The intended use of unblock_dem is simply to let you conveniently examine the files to see what is in them. However, if you are in the mood for adventure, or if you need to repair a defective file, you can use unblock_dem to make the file easy to edit, then you can edit the file as desired. Drawmap can still process the files after linefeeds are inserted, but will become confused if any line (including the linefeed) is more than 1024 characters long. Drawmap may also become confused if you make any significant changes to the format of the file. You may be able to use this capability to repair faulty data. However, you need to be familiar with the content and structure of DEM files in order to do this effectively. You also need to remember that drawmap depends on DEM files having a predictable structure, and it won't properly parse files that violate this predictability. Do this sort of thing only if you know what you are doing, or if you have a lot of free time on your hands. It should be noted that you can obtain a similar effect by using the command recommended by the USGS: dd if=inputfilename of=outputfilename ibs=4096 cbs=1024 conv=unblock I prefer the unblock_dem command because it simply replaces the last byte of each record with a linefeed. This lets me easily tell how long the original records were. The effect of unblock_dem or dd can be undone by typing: dd if=inputfilename of=outputfilename ibs=4096 cbs=1024 conv=block You may come across files that have a linefeed in the 1025th byte. Drawmap doesn't like these, both because it can't tell (within the space of the first 1024-byte record) whether the file contains linefeeds or not, and because the records exceed the maximum record length of 1024 bytes. You may be able to repair such files by blocking them with the above dd command. SEE ALSO
unblock_dlg(1), drawmap(1) Jul 24, 2001 UNBLOCK_DEM(1)
All times are GMT -4. The time now is 04:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy