If your awk version supports the sub() string function *and* if your record always have the same layout, here is another way of doing it:
Or, if you hate the one-liner style of coding: Edit: By reading the OP, I just realized that I stopped at the first request. So, go for the Radoulov's snippet. I can't think of anything better.
I am a beginner at shell scripting, actually i am working on my first script right now.
Anyway i have searched the world how to grep two letters from each word (it will always just be two words).
For example:
Example Blablabla
I want my script to cut out Ex (from the first word) and Bl... (4 Replies)
Hi
Is there a way to cut the last two characters off a word or number given that this word or number can be of varying length?
I have tried something like
TEST=`echo $OLD | cut -c 1-5`
where $OLD is a variable containing a number like 1234567 which gives a result of 12345. This is fine... (4 Replies)
Hi,
From the file "example" with lines like below, I need the int value associated with ENG , i.e, 123
SUB: ENG123, GROUP 1
SUB: HIS124, GROUP 1
..
..
Normally , i do
grep ENG example | cut -d ' ' -f 2 | cut -c 4-6
Is it possible to do it in simpler way using awk/sed ?
... (5 Replies)
Hi,
I am cutting data from a fixed length test file and then writing out a new record using the echo command, the problem I have is how to stop multiple spaces from being written to the output file as a single space.
Example:
cat filea | while read line
do
field1=`echo $line | cut -c1-2`
... (6 Replies)
hi people,
I have a text file containing data, seperated by TAB. I want to process this tab'ed data as variable. how can I assign this?
Ex:
Code:
11aaa 12000 13aaa 14aaa 15aaa 16aaa 17aaa
21aaa 22000 23aaa 24aaa 25aaa 26aaa 27aaa
31aaa 32000 33aaa 34aaa 35aaa 36aaa 37aaa... (1 Reply)
I have this filename "RBD_EXTRACT_a3468_d20131118.tar.gz" and I would like print out the "yyyymmdd" only. I use this command below, but if different command like cut or print....etc. Thanks
ls RBD_EXTRACT* | sed 's/.*\(........\).tar.gz$/\1/' > test.txt (9 Replies)
Discussion started by: dotran
9 Replies
LEARN ABOUT SUNOS
wnn_cvt_xim_tbl
wnn_cvt_xim_tbl(4) File Formats wnn_cvt_xim_tbl(4)NAME
wnn_cvt_xim_tbl - Key conversion table for xjsi
SYNOPSIS
/usr/lib/locale/ja/wnn/cvt_xim_tbl
DESCRIPTION
cvt_xim_tbl defines the conversion table for keyboard input and key code.xjsi(1) converts keyboard input (KeySym) to code (Wnn_code) by
using of cvt_key_tbl.
SYNTAX
State-or-KeySym Wnn_code
State-or-KeySym = [States]KeySym-name
States = State-name | [SState-or-KeySym and Wnn_code must be separated with a space character or tab. Lines beginning with a semicolon (;)
are comments.
CODE DESCRIPTION
Octal number 0??
Decimal number ??
Hexadecimal number 0x?? or 0X??
EXAMPLES
Example 1:
Meta|Left 0x9A
Meta|Up 0x99
Meta|F11 0x95
Meta|minus 0x81
Meta|asciicircum 0x82
Kanji 0x81
F1 0x91
F2 0x90
Meta|Shift|F1 0x91
SEE ALSO xjsi(1), uumkey(4), wnn_2A_CTRL(4)NOTES
Code converted by cvt_xim_tbl is evaluated by the Automaton table 2A_CTRL (default) and then by uumkey.
SunOS 5.10 10 Jan 2003 wnn_cvt_xim_tbl(4)