Sponsored Content
Top Forums Shell Programming and Scripting how to change every 3rd character Post 302151396 by uvrakesh on Saturday 15th of December 2007 03:49:39 AM
Old 12-15-2007
sed 's/\(..\)\(.\)\(.*\)/\1z\3/g' pattern
I think there exist simpler method
 

4 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

if 4th and 5th character of sting -ge 45 then add 1 to 3rd character

I want to know how to, given a string like W87151WR71C, if the 4th and 5th character (in this case 15) are greater than 45, then to add 1 to the 3rd character (in this case 7) and assign the revised string the variable name MODSTRING. Thanks in advance. This is ultimately to grab info from... (6 Replies)
Discussion started by: glev2005
6 Replies

2. Shell Programming and Scripting

Remove 3rd and onwards occurances of a character

I have a file with "@" in every line fdgfgddfg@sfsdfdsf@dfdfd@@vfdfsdfd@ sfsdfs@sdfd@gfhfgh@@ddffg@sdf@ srfgtfsdfs@sdfertrd@eergfhfgh@@ddffg@sdf@ wttrtrt@sdfd@sdfdf@@sdfdfds@@@ I need to remove all the fourth and onwards occurences of "@". so my final o/p would be fdgfgddfg@sfsdfdsf@dfdfd@... (7 Replies)
Discussion started by: Shivdatta
7 Replies

3. Shell Programming and Scripting

Remove 3rd character from the end of a random-length string

Hi, I hope someone can share there scripting fu on my problem, I would like to delete the 3rd character from a random length of string starting from the end Example Output Hope you can help me.. Thanks in advance.. (3 Replies)
Discussion started by: jao_madn
3 Replies

4. Shell Programming and Scripting

[Solved] Replace character in 3rd column and leave 1rst and last

Hello to all, I have the following text where columns are separated by spaces. I want to have the 3rd column separating 3 strings with 2 "_" in the format below: LeftSring_CentralString_RightString So, in 3rd column I want to replace all "_" with "-", except the first and last "_" The... (5 Replies)
Discussion started by: Ophiuchus
5 Replies
jconv8(7M)							  STREAMS Modules							jconv8(7M)

NAME
jconv8 - code conversion STREAMS module (8-bit JIS/Japanese EUC) SYNOPSIS
#include <sys/types.h> #include <sys/stropt.h> #include <sys/conf.h> ioctl(fd, I_PUSH, "jconv8"); DESCRIPTION
jconv8 is a STREAMS module that is available to be pushed onto a stream. Usually, this module has to be pushed onto a stream between a raw device such as ptem(7M) and terminal line discipline module such as ldterm(7M). jconv8 has to be pushed when you set 8-bit JIS terminal and control Japanese EUC data. It converts up stream for 8-bit JIS code into Japa- nese EUC and passes high module. It also converts down stream for Japanese EUC into 8-bit JIS code and passes low module. IOCTLS
jconv8 processes the following ioctls. JA_SKIOC and JA_GKIOC are specified pointer to the next structure as argument: struct kioc { char ki; char ko; }; JA_SKIOC Change the 3rd character of JIS kanji and ASCII indication escape sequence. JA_GKIOC Return the 3rd character of current JIS kanji and ASCII indication escape sequence. EUC_OXLON Start performing code conversion between 8-bit JIS and Japanese EUC for I/O stream. EUC_OXLOFF Stop performing code conversion between 8-bit JIS and Japanese EUC for I/O stream. SEE ALSO
jtty(1), setterm(1), stty(1), streamio(7I), jconv7(7M), jconvrs(7M), jconvru(7M), jconvs(7M), jconvu(7M), ldterm(7M), ptem(7M) NOTES
When you use jconv8 with jconvrs(7M) or jconvru(7M) at once and `raw' is specified by stty(1), code convert function automatically become off without specification by EUC_OXLON / EUC_OXLOFF. By default, character set indication escape sequences as follows. The end character may be changed by JA_SKIOC. o ASCII indication: ESC 2/8 4/10 o Character indication: ESC 2/4 4/2 o Convert with JIS X 0201 Kana: LS1/LS0 jconv8 does not support Kanji code for Information Interchange (secondary kanji set) provided by JIS X 0212-1990. When jconv8 is in use, csh(1) does not work properly for filename additional function. SunOS 5.10 13 Aug 1998 jconv8(7M)
All times are GMT -4. The time now is 06:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy