Sponsored Content
Top Forums Shell Programming and Scripting append existing file with zeroes bsed on position Post 302366060 by danmero on Wednesday 28th of October 2009 04:39:47 PM
Old 10-28-2009
Use gawk, nawk or /usr/xpg4/bin/awk on Solaris.
file is the input and you can redirect the output to another file(2).
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Shell script to append a time for the existing error log file

Hi Guys, the requirement is like this, i am having a error log file in this format, 4594.493: parallel nursery GC 2594592K->2544691K (2969600K), 30.848 ms 4605.958: parallel nursery GC 2634887K->2584986K (2969600K), 38.900 ms 4619.079: parallel nursery GC 2822555K->2774812K... (12 Replies)
Discussion started by: gsprasanna
12 Replies

2. Shell Programming and Scripting

Append line based on fixed position

Hi all; I'm having headache on append one line to another based on the fix position.Hope u guys can help. All i need to do is append the line that start with '3' to a line which start with '1' and the position for line 3 that i need to append is 22. The original file look like this: ... (2 Replies)
Discussion started by: ashikin_8119
2 Replies

3. Shell Programming and Scripting

append newline to existing variables

firstly, i check is the variable empty or not, if so vesselNameList=`echo $vesselName` if not vesselNameList="${vesselNameList}""\n"`echo "$vesselName"` and it produces this result BUNGA TERATAI 3 5055\ JADE TRADER 143W\ MOL SPLENDOR 0307A BUNGA TERATAI 3 5055\ JADE... (1 Reply)
Discussion started by: finalight
1 Replies

4. Shell Programming and Scripting

Add leading zeroes to numbers in a file

Hello, I am (trying) to write a script that will check to see how many users are logged on to my machine, and if that number is more than 60 I need to kill off all the oldest sessions that are over 60. So far I have been able to check how many users are on and now I am at the part where I have to... (3 Replies)
Discussion started by: raidzero
3 Replies

5. Shell Programming and Scripting

append each line on fixed position 31 to 33

I have a .DAT file like below. 26666666660001343 000001004OLF 029100020090820 27777777770000060 000001004ODL-CH001000020090820 28888888880000780 000001013OLF 006500020090820 ....... ........ and so on..... I want to append each line in a file in .KSH script with XXX with position... (5 Replies)
Discussion started by: kshuser
5 Replies

6. Shell Programming and Scripting

append the position 28:33

I have a file FILE1.DAT like below 21111111110001343 000001004OLF-AA029100020091112 21111111110000060 000001004ODL-CH001000020091112 24444444440001416 000001045OLF-AA011800020091112 23333333330001695 000001039OLF-AA030600020091112 23333333330000111 000001039ODL-SP002000020091112... (2 Replies)
Discussion started by: new2ksh
2 Replies

7. Shell Programming and Scripting

Append files to a existing tar file.

Hi all, I want to check whether tar file exists in the directory or not. If tar file exists in the directory then I want to append the files to it. I am using the below command to tar files if the file does not exist. tar zcvf <tar file name> <Files to append> However, if want to... (4 Replies)
Discussion started by: Nagaraja Akkiva
4 Replies

8. Shell Programming and Scripting

Append to existing line

I have a file which has lines that end with a plus (+) sign. I would like to get the next line appended to the one with the plus. For example bla bla bla bla bla + blip blip blip would become bla bla bla bla bla blip blip blip However not all lines end with a plus sign . I would... (2 Replies)
Discussion started by: bombcan
2 Replies

9. Shell Programming and Scripting

Perl - Append data to existing excel cell

Hello All, I have the following code in PERL to write data to excel sheet. Can someone please help me about how to append data to an exisitng cell? For ex in the below given case,Cell 1,1 has Active State PERL Now I want to add a new line like "prorgamming" without overwritting the... (3 Replies)
Discussion started by: prasperl
3 Replies

10. Shell Programming and Scripting

Matching column then append to existing File as new column

Good evening I have the below requirements, as I am not an experts in Linux/Unix and am looking for your ideas how I can do this. I have file called file1 and file2. I need to get the second column which is text1_random_alphabets and find that in file 2, if it's exists then print the 3rd... (4 Replies)
Discussion started by: mychbears
4 Replies
GRD2XYZ(l)																GRD2XYZ(l)

NAME
grd2xyz - Converting a grdfile to an ASCII or binary table SYNOPSIS
grd2xyz grdfile [ -H[nrec] ] [ -L ] [ -Rwest/east/south/north[r] [ -S[r ] [ -V ] [ -Z[flags] ] [ -bo[s][n] ] DESCRIPTION
grd2xyz reads a binary 2-D grdfile and writes out xyz-triplets in ASCII [or binary] format to standard output. Modify the precision of the ASCII output format by editing the D_FORMAT parameter in your .gmtdefaults file, or choose binary output using single or double precision storage. As an option you may output z-values without the (x,y) in a number of formats, see -Z below. grdfile The 2-D binary file to be converted. OPTIONS
-H Output 1 header record based on information in the grdfile header. Ignored if binary output is selected. [Default is no header]. -L Indicates that the x values are longitudes (necessary for -: to work). -R west, east, south, and north specify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the dd:mm[:ss] format. Append r if lower left and upper right map coordinates are given instead of wesn. -S Suppress output for nodes whose z-value equals NaN [Default outputs all nodes]. Append r to reverse the suppression, i.e., only output the nodes whose z-value equals NaN. -V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. -Z Write a 1-column ASCII [or binary] table. Output will be organized according to the specified ordering convention contained in flags. If data should be written by rows, make flags start with T(op) if first row is y = ymax or B(ottom) if first row is y = ymin. Then, append L or R to indicate that first element should start at left or right end of row. Likewise for column formats: start with L or R to position first column, and then append T or B to position first element in a row. For gridline registered grids: If grid is periodic in x but the outcoming data should not contain the (redundant) column at x = xmax, append x. For grid periodic in y, skip writing the redundant row at y = ymax by appending y. If the byte-order needs to be swapped, append w. Select one of several data types (all binary except a): a ASCII representation c signed 1-byte character u unsigned 1-byte character h short 2-byte integer i 4-byte integer l long (4- or 8-byte) integer f 4-byte floating point single precision d 8-byte floating point double precision Default format is scanline orientation of ASCII numbers: -ZTLa. Note that -Z only applies to 1-column output. -bo Selects binary output. Append s for single precision [Default is double]. This option only applies to xyz output; see -Z for z ta- ble output. EXAMPLES
To edit individual values in the 5' by 5' hawaii_grv.grd file, try grd2xyz hawaii_grv.grd > hawaii_grv.xyz To write a single precision binary file without the x,y positions from the file raw_data.grd file, using scanline orientation, try grd2xyz raw_data.grd -ZTLf > hawaii_grv.b SEE ALSO
gmtdefaults(1gmt), gmt(1gmt), grdedit(1gmt), xyz2grd(1gmt) 1 Jan 2004 GRD2XYZ(l)
All times are GMT -4. The time now is 11:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy