Sponsored Content
Full Discussion: Append file
Top Forums UNIX for Dummies Questions & Answers Append file Post 302365596 by Muhammad Rahiz on Tuesday 27th of October 2009 01:46:49 PM
Old 10-27-2009
Thanks red dove!

I just found out that it works using 'cat'.

cat file1 file2 > file 3 # appends content of the files in a single column

Paste however, appends contents by column.

paste file1 file2 > file 3
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Append a field to the end of each line of a file based on searching another file.

Hi All, I have two comma separated value(CSV) files, say FileA and FileB. The contents looks like that shown below. FileA EmpNo,Name,Age,Sex, 1000,ABC,23,M, 1001,DES,24,F, ... (2 Replies)
Discussion started by: ultimate
2 Replies

2. UNIX for Dummies Questions & Answers

Trying to empty file using > but the file size increasing when next append

AIX 5.3 / KSH I have a Java application which creates a log file a.log. I have a KSH script which does the following action cp a.log /directory2/b.log > a.log After this the file size goes to 0 as per "ls -l" Then next time when the application writes into this file, the file size... (4 Replies)
Discussion started by: firdousamir
4 Replies

3. Solaris

gzip a file and append creation date stamp to file

I want to gzip a file and append the creation date to the end of the file. How can I accomplish this task. Basically they are log files which need a creation date stamp appended to make sure they do not overwrite other log files. -jack (3 Replies)
Discussion started by: jacktravine
3 Replies

4. UNIX for Dummies Questions & Answers

How can I append a text at end of file after displaying the file

I have a file "sample.txt" with the content as below: Hi This is a Sample Text. I need a single command using cat which serve the following purpose. 1.display the contents of sample.txt 2.append some text to it 3. and then exit But, all should be served by a sinle command.:confused: (1 Reply)
Discussion started by: g.ashok
1 Replies

5. Shell Programming and Scripting

Unix Script file to Append Characters before rows in file.

Hi Experts, I am working on HP-UX. I am new to shell scripting. I would like to have a shell script which will prefix: 1. "H|" before first row of my file and, 2. "T" for all other rows of the file. For Example - File before running the script 20100430|4123451810|218.50|TC 20100430 ... (4 Replies)
Discussion started by: phani333
4 Replies

6. Shell Programming and Scripting

How to search and append words in the same file using unix scripting file operations

Hi , I have a file myhost.txt which contains below, 127.0.0.1 localhost 1.17.1.5 atrpx958 11.17.10.11 atrpx958zone nsybhost I need to append words only after "atrpx958" like 'myhost' and 'libhost' and not after atrpx958zone. How to search the word atrpx958(which is hostname) only,... (5 Replies)
Discussion started by: gsreeni
5 Replies

7. UNIX for Dummies Questions & Answers

How to append portion of a file content to another file when a certain pattern is matching?

Hi ladies and gentleman.. I have two text file with me. I need to replace one of the file content to another file if one both files have a matching pattern. Example: text1.txt: ABCD 1234567,HELLO_WORLDA,HELLO_WORLDB DCBA 3456789,HELLO_WORLDE,HELLO_WORLDF text2.txt: XXXX,ABCD... (25 Replies)
Discussion started by: bananamen
25 Replies

8. Shell Programming and Scripting

Help with ksh-to read ip file & append lines to another file based on pattern match

Hi, I need help with this- input.txt : L B white X Y white A B brown M Y black Read this input file and if 3rd column is "white", then add specific lines to another file insert.txt. If 3rd column is brown, add different set of lines to insert.txt, and so on. For example, the given... (6 Replies)
Discussion started by: prashob123
6 Replies

9. Shell Programming and Scripting

Want it to read the file name and then append date stamp at the end of file?

I was thinking something like for i in `find . -name "*.log.Z"`; do mv $i name.log.Z or something like that? (3 Replies)
Discussion started by: xgringo
3 Replies

10. UNIX for Beginners Questions & Answers

awk to update file with partial matching line in another file and append text

In the awk below I am trying to cp and paste each matching line in f2 to $3 in f1 if $2 of f1 is in the line in f2 somewhere. There will always be a match (usually more then 1) and my actual data is much larger (several hundreds of lines) in both f1 and f2. When the line in f2 is pasted to $3 in... (4 Replies)
Discussion started by: cmccabe
4 Replies
NC2XY(1gmt)						       Generic Mapping Tools						       NC2XY(1gmt)

NAME
nc2xy - Converting netCDF column file(s) to ASCII xy data SYNOPSIS
nc2xy files [ -Fvar1/var2/... ] [ -S[r] ] [ -V ] [ -fcolinfo ] [ -bo ] DESCRIPTION
nc2xy reads one or more netCDF files with column data and writes out those columns in ASCII format to standard output, so that they can be used by psxy, psxyz, or xyz2grd. Modify the precision of the ASCII output format by editing the D_FORMAT parameter in your .gmtdefaults4 file or use --D_FORMAT=value on the command line. files Names of netCDF files to be converted. OPTIONS
-F Specify up to 10 names of the variables (separated by slashes) to be printed out. All variables to be 1-dimensional and be of equal length. When omited, the first two variables in the netCDF file will be printed. -S Suppress output for records with one or more NaN values [Default outputs all nodes]. Append r to reverse the suppression, i.e., only output the records with at least one NaN value. -V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. -bo Selects binary output. Append s for single precision [Default is d (double)]. Uppercase S or D will force byte-swapping. Option- ally, append ncol, the number of desired columns in your binary output file. -f Special formatting of input and/or output columns (time or geographical data). Specify i or o to make this apply only to input or output [Default applies to both]. Give one or more columns (or column ranges) separated by commas. Append T (absolute calendar time), t (relative time in chosen TIME_UNIT since TIME_EPOCH), x (longitude), y (latitude), or f (floating point) to each column or column range item. Shorthand -f[i|o]g means -f[i|o]0x,1y (geographic coordinates). See also TIME COORDINATES below. TIME COORDINATES
Time coordinates in netCDF files will be recognized as such. The variable's unit attribute is parsed to determine the unit and epoch of the time coordinate in the grid. Values are then converted to the internal time system specified by TIME_UNIT and TIME_EPOCH in the .gmt- defaults file or on the command line. The default output is relative time in that time system, or absolute time when using the option -f0T, -f1T, etc. EXAMPLES
To print out latitude, longitude and height in a netCDF file as ASCII records, while suppressing all NaN values: nc2xy -Flat/lon/height -S trackfile.nc > trackfile.xy SEE ALSO
gmtdefaults(1), GMT(1), psxy(1), psxyz(1), xyz2grd(1) GMT 4.5.7 15 Jul 2011 NC2XY(1gmt)
All times are GMT -4. The time now is 11:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy