The previous post is only for GNU sed that is compiled with a recent glibc that has got the \S \s from perl (PCRE).
If you want portability, use the original! Most commercial Unixes have got perl.
This works, but in warning mode it says
Since perl 5.x it issues this warning. Fix: $n is like a variable that you can write ${n} (just like a variable in the shell).
Demo:
This User Gave Thanks to MadeInGermany For This Post:
Hi, Iam new to unix. I have one input file .
Input file :
ID1~Name1~Place1
ID2~Name2~Place2
ID3~Name3~Place3
I need output such that only first column should change to fixed width column of 15 characters of length.
Output File:
ID1<<12 spaces>>Name1~Place1
ID2<<12... (5 Replies)
Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2
file 1 sample
SNDK 80004C101 AT
XLNX 983919101 BB
NETL 64118B100 BS
AMD 007903107 CC
KLAC 482480100 DC
TER 880770102 KATS
ATHR 04743P108 KATS... (7 Replies)
Hi everyone, and thanks after all
I'm a biologist and i have to extract information from one text. The text is something like this
1023 A A 56 0 cc...,,,,..gg..Cc.c,,c..CC..,,
1024 T T 86 0 ..,,,..aaAA..,,aAA,,a,,A,,a
1025 G G 125 0 ... (5 Replies)
Hi
I wanted to fetch particular characters from a column.I have a file having columns separated by pipe operator.
The contents of the file are Task | Task started on a component | B678C56D-96DA-4FFC-B40E-9A032A2EB12E-0000004 | service.adapter:UCF Version Creator
... (2 Replies)
Hello all,
I have a data like this:
X:04252 X:05524 X:04176
X:05509 X:05524 X:04674-
X:1662912 X:10181
X:16491 X:05506
X:05216- X:05488
X:46872 X:08471
X:04834 X:30170
The except result is like this:
X:04252 X:05524 X:04176
X:05509 X:05524 X:04674
X:16629 X:10181... (3 Replies)
This is my input file :
# cat list 20130430121600, cucm, location,76,2 20130430121600,cucm1,location1,76,4 20130430122000,cucm,location,80,8 20130430122000,cucm1,location1,90,8 20130430140000,cucm1,location1,87,11 20130430140000, cucm,location,67,9
This is the required output
... (1 Reply)
I need to delete the last 11 characters from each number and they are all in the same line (each is in a different column):
-6.89080901827020800000 3.49348891708562325136 1.47988367839905286876 -2.29707635413510400000 -3.49342364708562325136 -4.43758473239905286876 -2.29707635413510400000... (14 Replies)
I have a file as follows
ATOM 5181 N AMET K 406 12.440 6.552 25.691 0.50 7.37 N
ATOM 5182 CA AMET K 406 13.685 5.798 25.578 0.50 5.87 C
ATOM 5183 C AMET K 406 14.045 5.179 26.909 0.50 5.07 C
ATOM 5184 O MET K... (14 Replies)
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Hello all,
I want to consolidate my data group by cities into 4 rolled up code categories (first 2 characters of 2nd col), namely PR, GR, TY and others.
CHICAGO PR1
CHICAGO GR3
CHICAGO GR4
CHICAGO HT5
CHICAGO HT6
CHICAGO TY5
HOUSTON PR3
HOUSTON PR9
HOUSTON TY4
HOUSTON HJ5... (1 Reply)
Discussion started by: jalaj841
1 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)