Adding a new column in a file with other existing columns
Hi All ,
Kindly help me with this soln
where
value of variable c I am externally giving input
But executing the above command shows all the columns of infile where as I want only 1st column of infile and 2nd column should print value c
Last edited by jim mcnamara; 09-20-2010 at 11:43 AM..
Reason: code tags please
Dear All,
I need to add a header of one line to an already existing file.
I know that it can be achieved by the following:
echo "Header" > newfile
cat file1 >> newfile
But my problem is that file is huge and there is no space for creating a new file every time. Is there a way that I can... (5 Replies)
Hi guys,
Please help me if u have some solution.
I have a file with three columns separated by ':' -
INPUT_FILE
C416722_2 : calin Dirigent : Dirigent
AC4174_6 : Jac : cal_co
TC4260_5 : [no : lin kite
BC426302_1 : [no : calin Dirigent lin
JC426540_3 : lin Pymo_bin : calin
TC428_3 : no7... (4 Replies)
Hi Friends,
I want to know the command to add a new file in a existing tar file.
For Ex:
I have a tar file file1.tar with the contents
one.txt
two.txt
three.txt
Now I need to add file four.txt to this existing tar file, how can I do it?
Thanks in advance (4 Replies)
I have a file with 50,000 records in it, i have a requirement to use the same 50,000 records and add them 4 times to the same file to make a total of 200,000 records. I was wondering how to do this using ksh. Any help is greatly appreciated. (2 Replies)
Hi!
I would need some help to add the last two columns of one file into another file using awk (or something similar).
For example, I have:
file 1: file 2:
car book day root lag
bar look pay boot tag
tar took may moot sag
I want to have:... (5 Replies)
Hello
I have a file as below
chr1 start ref alt code1 code2
chr1 18884 C CAAAA 2 0
chr1 135419 TATACA T 2 0
chr1 332045 T TTG 0 2
chr1 453838 T TAC 2 0
chr1 567652 T TG 1 0
chr1 602541 ... (2 Replies)
Hello,
I am very now to this, hope you can help,
I am looking into editing a file in Solaris, with dinamic collums (lenght varies) and I need 2 things to be made, the fist is to filter the first column and third column from the file bellow file.txt, and create a new file with the 2 filtered... (8 Replies)
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
LEARN ABOUT OSX
sample1d
SAMPLE1D(l) SAMPLE1D(l)
NAME
sample1d - Resampling of 1-D data sets
SYNOPSIS
sample1d infile [ -Fl|a|c ] [ -H[nrec] ] [ -Ixinc ] [ -M[flag] ] [ -Nknotfile ] [ -Sxstart ] [ -Tx-col] [ -V ] [ -bi[s][n] ] [ -bo[s][n] ]
DESCRIPTION
sample1d reads a multi-column ASCII [or binary] data set from file [or standard input] and resamples the timeseries/profile at locations
where the user needs the values. The user must provide the column number of the independent (monotonically increasing or decreasing) vari-
able. Equidistant or arbitrary sampling can be selected. All columns are resampled based on the new sampling interval. Several interpola-
tion schemes are available.
infile This is a multi-column ASCII [of binary, see -b] file with one column containing the independent variable (which must be monotoni-
cally in/de-creasing) and the remaining columns holding misc. data values. If no file is provided, sample1d reads from standard
input.
OPTIONS
No space between the option flag and the associated arguments.
-F Choose from l (Linear), a (Akima spline), and c (natural cubic spline) [Default is -Fa]. You may change the default interpolant;
see INTERPOLANT in your .gmtdefaults file.
-H Input file(s) has Header record(s). Number of header records can be changed by editing your .gmtdefaults file. If used, GMT default
is 1 header record.
-I xinc defines the sampling interval. [Default is the separation between the first and second abcissa point in the infile]
-M Multiple segment file. Segments are separated by a record whose first character is flag. [Default is '>'].
-N knotfile is an optional ASCII file with the x locations where the data set will be resampled in the first column
-S For equidistant sampling, xstart indicates the location of the first output value. [Default is the smallest even multiple of xinc
inside the range of infile]
-T Sets the column number of the independent variable [Default is 0 (first)].
-V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
-bi Selects binary input. Append s for single precision [Default is double]. Append n for the number of columns in the binary file(s).
[Default is 2 (or at least the number of columns implied by -T].
-bo Selects binary output. Append s for single precision [Default is double].
EXAMPLES
To resample the file profiles.tdgmb, which contains (time,distance,gravity,magnetics,bathymetry) records, at 1km equidistant intervals
using Akima's spline, try'
sample1d profiles.tdgmb -I1 -Fa -T1 > profiles_equi_d.tdgmb
To resample the file depths.dt at positions listed in the file grav_pos.dg, using a cubic spline for the interpolation, try
sample1d depths.dt -Ngrav_pos.dg -Fc > new_depths.dt
SEE ALSO gmt(1gmt), filter1d(1gmt)
1 Jan 2004 SAMPLE1D(l)