Having fought BASH on this a while, changing IFS does not help...
I would try converting "empty" columns into non-empty columns, plugging them with spaces or something. Or just use a language which considers them as multiple columns already, like awk.
Hi
I have a txt file with 4 columns where I need to add 4 empty columns in the middle meaning that I need what is currently column 4 to be column 8 in a new file.
The idea is that I have to use the file as input in a program that reads the data in column 1 and 8, so the content of the other... (8 Replies)
Hello,
I am trying to parse a file that resembles the last three groupings into something looking like the first two lines. I've fiddled with sed and awk a bit, but can't get anything to work properly. I need them separated by some delimiter. The file is some 23,000 lines of the stuff....
... (9 Replies)
Hi,
I have a small requirement where i need to sum up a column in a text file.
Input file
66ab 000000 534385 -00000106350.00
66cd 000000 534485 -00013364511.00
66ad 000000 534485 -00000426548.00
672a 000000 534485 000000650339.82... (5 Replies)
Dear all,
I have a file in this format (like a matrix)
- A B C .. X
A 1 4 2 .. 2
B 2 6 4 .. 8
C 3 5 5 .. 4
. . . ... .
X . . ... .
and want to convert it into a file with this format:
A A = 1
A B = 4
A C = 2
...
A X = 2
B A = 2
B B = 6
etc (2 Replies)
hello all,
i have an input file like that
A A X0
A B X1
A C X2
...
A Z Xx
B A X1
B B X3
....
Z A Xx
Z B X4
and i want to have an output like that
A B C D
A X0 X1 X2 Xy
B X1 X3 X4 (4 Replies)
Hello all,
I have a file which is tab separated like that:
PHE_205_A TIP_127_W ARG_150_B
MET_1150_A TIP_12_W VAL_11_B
GLU_60_A TIP_130_W ARG_143_B
LEU_1033_A TIP_203_W ARG_14_B
SER_1092_A TIP_203_W
THR_1090_A TIP_203_W
SER_1092_A TIP_25_W ... (6 Replies)
Hi,
I have created a tab separated file from the following input file.
ADDRESS1 CITY STATE POSTAL COUNTRY LON LAT
32 PRINZREGENTENSTRASSE ROSENHEIM BAYERN 83022 DEU 1212182 4785699
263 VIA DANTE ALIGHIERI BARI PUGLIA 70122 ITA 1686233 4112154
30 VIA MILANO ... (1 Reply)
I'm trying to remove all of the empty lines at the end of a Tab delimited file. They have no data just tabs.
I've tried may things, here are a couple:
sed /^\t.\t/d File1 > File2
sed /^\t{44}/d File1 > File2
What am I missing? (9 Replies)
Hi,
I have a tab separated. I want to replace all the "&" in 8th column of the file with "and" .I am trying with
awk -F, -vOFS=\\t '{$8=($8=="&")?"and":$8}1' test> test1.txt
My file is abc def ghk hjk lkm hgb jkluy acvf & bhj hihuhu fgg
me mine he her go went has has & had hgf hgy
... (1 Reply)
Hello Everyone..
I want to replace the retail col from FileI with cstp1 col from FileP if the strpno matches in both files
FileP.txt
... (2 Replies)
Discussion started by: YogeshG
2 Replies
LEARN ABOUT HPUX
unexpand
expand(1) General Commands Manual expand(1)NAME
expand, unexpand - expand tabs to spaces, and vice versa
SYNOPSIS
tablist] [file ...]
tablist] [file ...]
Obsolescent:
tabstop] tabn] [file ...]
DESCRIPTION
processes the named files or the standard input and writes to the standard output with tabs changed into spaces. Backspace characters are
preserved in the output, and the column count is decreased by one column for tab calculations. For proper tab calculation, if a multi-col-
umn character is to be "backspace'd", it should be followed by multiple backspace characters which equal to it's column width. If a tab
character is found after the last tab position, it is replaced by a single space. is useful for preprocessing character files that contain
tabs (before sorting, looking at specific columns, etc).
recognizes the following command-line options and arguments:
tablist specifies where to set the tab positions instead of the default tablist can take two forms. If it is a single num-
ber, tabs are set tablist spaces apart. tablist can also be a blank- or comma-separated list of increasing positions
where tabs are to be set.
This option is obsolescent and is equivalent to using
This option is obsolescent and is equivalent to using
processes the named files or the standard input and writes to the standard output with spaces changed into tabs where possible. By
default, only leading spaces and tabs are converted to maximal strings of tabs. The default tab position is every 8 characters. Backspace
characters are preserved into the output, and the column count is decreased by one column for tab calculations. For proper tab calcula-
tion, if a multi-column character is to be "backspace'd", it should be followed by multiple backspace characters which equal to it's column
width.
recognizes the following command-line options and arguments:
Tabs are inserted whenever they would compress the resultant file
by replacing two or more spaces before a tab position.
tablist specifies the tab positions. tablist can take two forms. If it is a single number, tabs are set every tablist spa-
ces apart. If tablist is a blank- or comma-separated list of increasing positions, tabs are set at those locations.
The option implies the option. If the option is not specified, the default is equivalent to specifying except that
is not implied for this case.
EXTERNAL INFLUENCES
Environment Variables
determines the interpretation of text as single and/or multi-byte characters.
determines the language in which messages are displayed.
If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty
variable. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of
If any internationalization variable contains an invalid setting, and behave as if all internationalization variables are set to "C". See
environ(5).
If is set to a non-empty string value, it overrides the values of all the other internationalization variables.
International Code Set Support
Single- and multi-byte character code sets are supported with the exception that do not recognize multi-byte alternative space characters.
STANDARDS CONFORMANCE expand(1)