Sponsored Content
Full Discussion: Find and replace in awk
Top Forums Shell Programming and Scripting Find and replace in awk Post 302964964 by cmccabe on Thursday 21st of January 2016 12:34:21 PM
Old 01-21-2016
I am sorry for the lack of detail. The string TestB will always be the same. The digits after it vary as sometimes it will be 2016 others 2020, and others 2022. Thank you Smilie.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk: find and replace in certain field only, help needed

I got a sample file like this. $ cat test 12|13|100|s 12|13|100|s 100|13|100|s 12|13|100|s I want to replace all 100 by 2000 only in 3rd field using "awk" This is replacing all 100's :-( $ awk -F "|" '{gsub( /100/,"2000");print}' test 12|13|2000|s 12|13|2000|s 2000|13|2000|s... (5 Replies)
Discussion started by: jkl_jkl
5 Replies

2. Shell Programming and Scripting

awk find/replace

Greetings all. I have web site that has long option and switch lists. When I insert something new into these files, the lists need to be reordered. IE: 1 => apple 2 => pear 3 => bannana 4 => orange --------------------- Add grape as #2 1 => apple 2 => grape 3 => pear 4 =>... (2 Replies)
Discussion started by: RobertSubnet
2 Replies

3. Shell Programming and Scripting

awk help to do conditional find and replace

Hi, I have a Line input for awk as follows DROP MATERIALIZED VIEW MCR.COMM_STACK; CREATE MATERIALIZED VIEW "MCR"."COMM_STACK" ON PREBUILT TABLE WITHOUT REDUCED PRECISION USING INDEX REFRESH FAST ON DEMAND START WITH sysdate+0 NEXT SYSDATE + 7 WITH PRIMARY KEY USING DEFAULT... (3 Replies)
Discussion started by: rajan_san
3 Replies

4. Shell Programming and Scripting

Simple find and replace with AWK

I am trying to write a find and replace script with AWK and I can't seem to get it to work. I need it to find this exact string *P*: and replace the P with a T or just replcare the whole thing with *T*:. this is what I have tried awk 'BEGIN {gsub(/\*P*:/,"\*T*:"); print}' ${INFILE} >... (4 Replies)
Discussion started by: wbshrk
4 Replies

5. Shell Programming and Scripting

find and replace issue using awk

Hi All, point 1. I have n number of environment variable files in different folders. All file names are ending with one thing common ie, *envset.sh point 2. All these contains Varilables and some other information like following *envset.sh ===>> ... (3 Replies)
Discussion started by: nitin.pathak
3 Replies

6. Shell Programming and Scripting

AWK Substr - find and replace question...

Hello Experts, I have a input file that I need to replace a value only if the file contains the number 6 in column 1. I would like to use AWK in a shell script (ksh on a AIX platform). I need all rows written out, but only change 2 fields when the first column contains a numer 6. Input... (2 Replies)
Discussion started by: scottb
2 Replies

7. Shell Programming and Scripting

sed and awk -Find and Replace

All, I have thousands of lines in a file with following format DATA=_ONE_XXX_YYY_CCC_HHHG_ DATA1=_GGG_JJJJ_HHH_UUU_JJJJ_HHHH_LLL_ DATA3=_MMM_GG_NN_QQQQ_FFF_III_ I want to replace _ with . by ignoring the first (=_) and last (_) So that out put should looks like... (4 Replies)
Discussion started by: baluchen
4 Replies

8. Shell Programming and Scripting

Find and Replace in awk

Friends, I have more the thousand lines like this. check.cloud1.port=342 check.cloud2.port=5456 check.cloud3.port-4564 But we need to transfer it to _CHECK.CLOUD1.PORT_=342 _CHECK.CLOUD2.PORT_=5456 _CHECK.CLOUD3.PORT_=4564 Any one could pls help of this. Thanks in Advance ... (1 Reply)
Discussion started by: jothi basu
1 Replies

9. Shell Programming and Scripting

Find fields and replace using awk

Code: Using ksh Var1=`awk -F";" {print $1}' Input2.txt` cat Input1.txt | awk -F";" '{$3="Var1"}' > Output.txt (13 Replies)
Discussion started by: Roozo
13 Replies

10. Shell Programming and Scripting

awk - find first occurence and replace it

Hello, I have a requirement to replace the whole string with first occurence of value of a key-value pair. I have to do this inside awk, as the data I need to work is inside an awk loop. value of my variable(say LogText) looks like: LogText= date=04Mar message=hello1 name=caq... (4 Replies)
Discussion started by: cool.aquarian
4 Replies
iso2022jp(5)							File Formats Manual						      iso2022jp(5)

NAME
iso2022jp, iso-2022-jp, ISO-2022-JP - A character encoding system (codeset) for Japanese DESCRIPTION
The ISO-2022-JP codeset consists of the following character sets: ASCII For information on the ASCII character set, refer to ascii(5). JIS X0201-1976 Only the Roman letters in this character set are included. For details, refer to deckanji(5). JIS X0208-1978 JIS X0208-1983 JIS X0208-1983 is a revised version of JIS X0208-1978 and remapped some characters of JIS X0208-1978 to other positions. Before a character is used, its corresponding character set must be designated. In ISO-2022-JP, the designation of a character set is done by using an escape sequence as follows: --------------------------------------------------------------- Escape Sequence Character Set --------------------------------------------------------------- ESC ( B ACSII ESC ( J JIS X0201-1976 (left-hand part) ESC $ @ JIS X0208-1978 ESC $ ( 0 User-defined characters (This range of char- acters is proprietary to Compaq.) ESC $ B JIS X0208-1983 --------------------------------------------------------------- It is assumed that the starting code of a line is ASCII (including CR alone and LF alone, but not including the combination CRLF). If there are JIS X0208 characters on a line, there must be a switch to ASCII or to the left-hand part of JIS X0201 (Roman letters) before the end of the line (in other words, before the CRLF, or carriage return and line feed). For example, if a line starts with the ASCII character 9, followed by the JIS X0208-1978 character at row 16 column 1, the line is encoded as follows: 39h ESC $ @ 30h 21h .... ESC ( B .... CRLF If a line starts with the JIS X0208-1978 character at row 16 column 1, followed by the ASCII character 9, then the line is encoded as fol- lows: ESC $ @ 30h 21h ESC ( B 39h .... CRLF Once a character set is designated, there is no need to redesignate the character set if the adjacent character belongs to the same charac- ter set. For example, the following practice is not recommended: ESC $ B .... ESC $ B .... Currently, the operating system supports the ISO 2022-JP codeset only through codeset converters; there is no direct support through locales or fonts. For your options in printing and displaying Japanese characters, refer to i18n_printing(5) and Japanese(5). Codeset Conversion The following codeset converter pairs are available for converting Japanese characters between ISO-2022-JP and other encoding formats. In converter names, the string ISO-2022-JP indicates that user-defined characters are not included in the conversion jwhile the string ISO-2022-JPext indicates that user-defined characters are included in the convertsion. Refer to iconv_intro(5) for an introduction to code- set conversion. For more information about the other codeset for which ISO-2022-JP or ISO-2022-JPext is the input or output, see the refer- ence page specified in the list item. deckanji_ISO-2022-JP or deckanji_ISO-2022-JPext, ISO-2022-JP_deckanji or ISO-2022-JPext_deckanji Converting from and to the DEC Kanji codeset: deckanji(5). eucJP_ISO-2022-JP or eucJP_ISO-2022-JPext, ISO-2022-JP_eucJP or ISO-2022-JPext_eucJP Converting from and to Japanese Extended UNIX Code: eucJP(5). sdeckanji_ISO-2022-JP or sdeckanji_ISO-2022-JPext, ISO-2022-JP_sdeck- anji or ISO-2022-JPext_sdeckanji Converting from and to the Super DEC Kanji codeset: sdeckanji(5). SJIS_ISO-2022-JP or SJIS_ISO-2022-JPext, ISO-2022-JP_SJIS or ISO-2022-JPext_SJIS Converting from and to the Shift JIS codeset: SJIS(5). Note that SJIS encoding is equivalent to the Microsoft code-page format used on PC systems. Therefore, you can use these converters to convert Japanese characters between the ISO 2022-JP and PC code-page formats. See code_page(5) for information on how the operat- ing system supports PC code pages. SEE ALSO
Commands: locale(1) Others: ascii(5), code_page(5), deckanji(5), eucJP(5), i18n_intro(5), i18n_printing(5), iconv_intro(5), iso2022(5), Japanese(5), jiskanji(5), l10n_intro(5), sdeckanji(5), shiftjis(5) iso2022jp(5)
All times are GMT -4. The time now is 06:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy