You wanted to enter the substring coordinates in the n,m format. Try this small adaption of Don Cragun's suggestion:
@Don Cragun: there seems to be missing the $ sign preceding the i loop variable?
In the standards, a variable name (but, obviously, not a positional parameter) in expression in:
can be presented with or without a leading <dollar-sign> character to get the value to which the variable expands. At least in bash and in ksh, the same is true in the expression in
These 2 Users Gave Thanks to Don Cragun For This Post:
Hi,
I have a file which contains records of data.
I need to split the file into multiple files depending upon the value of last field.
How do i read the last field of each record in the file???
Regards,
Chaitrali (4 Replies)
Hi All,
I have a file like below:
1016D"ddd","343","1299"
1016D"ddd","3564","1299"
1016D"ddd","3297","1393"
1016D"ddd","32989","1527"
1016D"ddd","346498","1652"
2312D"ddd","3269","1652"
2312D"ddd","328","1652"
2312D"ddd","2224","2100"
3444D"ddd","252","2100"
3444D"ddd","2619","2100"... (4 Replies)
I have a pipe delimited input file as below. First byte of the each line indicate the record type. Then i need to split the file based on record_type = null,0,1,2,6 and create 5 files. How do i do this in a ksh script? Pls help
|sl||SL|SL|SL|1996/04/03|1988/09/15|C|A|sl||||*|... (4 Replies)
Hi,
I have a data file xyz.dat similar to the one given below,
2345|98|809||x|969|0
2345|98|809||y|0|537
2345|97|809||x|544|0
2345|97|809||y|0|651
9685|98|809||x|321|0
9685|98|809||y|0|357
9685|98|709||x|687|0
9685|98|709||y|0|234
2315|98|809||x|564|0
2315|98|809||y|0|537... (2 Replies)
Hi ,
my file look likes below ,
cat file.csv
12/09/2014,50,5,0,300
12/09/2014, ,5,0,300
12/09/2014,50,,,300
i need to split file , the first one contains values (2nd column is 50 , 3rd and fourth column is null )
the second file contains all others
firstfile
... (2 Replies)
I have a unix file text.txt with below content
aaaaa
bbbbbbb
cccccccccc
As of 2013
ddddddddd
eeeeeeeeee
eeeeeeeee
fffffffff
As of 2014
gggggggggggg
hhhhhhhhh
iiiiiiiiiiiiiiii
As of 2016
Now I've to split this file with each file ending with line 'As of' . Please suggest how can I do... (6 Replies)
Hi
I have a requirement of taking time as input variable outside the script.depending on the time it will check the file output .like
./script.sh <30 min>
so script.sh should run every 5 minutes ie.6 times to check the output file.Can any one please help here. (7 Replies)
Hi All,
I have a UNIX script which reads "PxyType" (read PxyType) as input from user and a file (eg : "File.json") with the list all PxyType's.
Based on the user input for "PxyType" in "File.json", I want to redirect each matched line to a different file ("File1,2,3,..json").
Can you... (7 Replies)
Hello Unix gurus,
I have a file with this format (example values):
label1 1 0
label2 1 0
label3 0.4 0.6
label4 0.5 0.5
label5 0.1 0.9
label6 0.9 0.1
in which:
column 1 is a row label
column 2 and 3 are values
I would like to do a simple operation on this table and get the... (8 Replies)
Discussion started by: ksennin
8 Replies
LEARN ABOUT REDHAT
column
COLUMN(1) BSD General Commands Manual COLUMN(1)NAME
column -- columnate lists
SYNOPSIS
column [-tx] [-c columns] [-s sep] [file ...]
DESCRIPTION
The column utility formats its input into multiple columns. Rows are filled before columns. Input is taken from file operands, or, by
default, from the standard input. Empty lines are ignored.
The options are as follows:
-c Output is formatted for a display columns wide.
-s Specify a set of characters to be used to delimit columns for the -t option.
-t Determine the number of columns the input contains and create a table. Columns are delimited with whitespace, by default, or with
the characters supplied using the -s option. Useful for pretty-printing displays.
-x Fill columns before filling rows.
Column exits 0 on success, >0 if an error occurred.
ENVIRONMENT
COLUMNS The environment variable COLUMNS is used to determine the size of the screen if no other information is available.
EXAMPLES
(printf "PERM LINKS OWNER GROUP SIZE MONTH DAY HH:MM/YEAR NAME
"
; ls -l | sed 1d) | column -t
SEE ALSO colrm(1), ls(1), paste(1), sort(1)HISTORY
The column command appeared in 4.3BSD-Reno.
BSD June 6, 1993 BSD