Sponsored Content
Top Forums Shell Programming and Scripting AWK adding prefix/suffix to list of strings Post 302625667 by chrisjorg on Wednesday 18th of April 2012 05:47:18 AM
Old 04-18-2012
AWK adding prefix/suffix to list of strings

Code:
75
103
131
133
138
183
197
221
232
234
248
256
286
342
368
389
463
499
524
538
556
564

For this list of strings I would like to add a preifx, pdb_, and a suffix .namd
How might one do this for all records?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

prefix suffix to each argument

Hi, I have a variable, which contains comma separated values. Something like. StringA="abc,def,ghi,jkl" I want to apply prefix and suffix to each value in the string without using any loops. Say if Prefix is Pre_ and Suffix is _Suf then I need to get ... (1 Reply)
Discussion started by: tostay2003
1 Replies

2. Shell Programming and Scripting

Awk search for a element in the list of strings

Hi, how do I match a particular element in a list and replace it with blank? awk 'sub///' $FILE list="AL, AK, AZ, AR, CA, CO, CT, DE, FL, GA, HI, ID, IL, IN, IA, KS, KY, LA, ME, MD, MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NY, NC, ND, OH, OK, OR, PA, RI, SC, SD, TN, TX, UT, VT, VA, WA,... (2 Replies)
Discussion started by: grossgermany
2 Replies

3. Shell Programming and Scripting

Adding new lines to a file + adding suffix to a pattern

I need some help with adding lines to file and substitute a pattern. Ok I have a file: #cat names.txt name: John Doe stationed: 1 name: Michael Sweets stationed: 41 . . . And would like to change it to: name: John Doe employed permanently stationed: 1-office (7 Replies)
Discussion started by: hemo21
7 Replies

4. Shell Programming and Scripting

Adding prefix to the values in the script

Hi, test.txt contains below values 1 2 3 4 5 Desired output: 'TT.1', 'TT.2', 'TT.3', 'TT.4', 'TT.5' Last value should not contain the comma after the value. Below is the script which i have tried. I'm using Linux. #!/bin/bash for i in $test.txt (4 Replies)
Discussion started by: venkatesht
4 Replies

5. Linux

Adding a prefix to a column using awk/sed commands

Hello, I am a newbie to linux and struggling to find a better way to append a column in a text file. Here is the file i want to modify: It has 8 columns (and thousands of rows). I want to append the first column by adding "chr" infront of the numbers. Some rows have a string in the first... (4 Replies)
Discussion started by: bjorngill
4 Replies

6. Shell Programming and Scripting

Replace prefix and suffix of a string

Hi, I'm new about shell scripting, and I need to do something like abcd **1234** efgh by abcd '''1234''' efgh I know that command sed helps about change one string by another, but I dont know how to keep whatever is inside **_** and replace * with '. Thanks! (5 Replies)
Discussion started by: selvaya
5 Replies

7. UNIX for Dummies Questions & Answers

Find EXACT word in files, just the word: no prefix, no suffix, no 'similar', just the word

I have a file that has the words I want to find in other files (but lets say I just want to find my words in a single file). Those words are IDs, so if my word is ZZZ4, outputs like aaZZZ4, ZZZ4bb, aaZZZ4bb, ZZ4, ZZZ, ZyZ4, ZZZ4.8 (or anything like that) WON'T BE USEFUL. I need the whole word... (6 Replies)
Discussion started by: chicchan
6 Replies

8. Shell Programming and Scripting

Common prefix of a list of strings

Is there a simple way to find the longest common prefix of a space-separated list of strings, optionally by field? For example, given input: "aaa_b_cc aaa_b_cc_ddd aaa_b_cc aaa_b_cd"with no field separator, output: aaa_b_cwith _ field separator, output: aaa_bI have an awk solution which... (1 Reply)
Discussion started by: CarloM
1 Replies

9. Shell Programming and Scripting

Suffix formatting with awk

i would like to format the 9 character with suffix as "0". i tried below it doesn't work. >a=12345 > echo $a | awk '{printf "%-09s\n",$1}' >12345 required output is 123450000 can you guys help me out ? (7 Replies)
Discussion started by: expert
7 Replies

10. UNIX for Advanced & Expert Users

Prefix/Suffix on same file

Hi, I want to add prefix and suffix on line# 205 using SED or AWK and want to change on the same file without creating new file. This command will be used in the bash script Am using Bash shell Regards Nayaj (3 Replies)
Discussion started by: Nayaj
3 Replies
CP1251(7)						     Linux Programmer's Manual							 CP1251(7)

NAME
cp1251 - CP 1251 character set encoded in octal, decimal, and hexadecimal DESCRIPTION
The Windows Code Pages include several 8-bit extensions to the ASCII character set (also known as ISO 646-IRV). CP 1251 encodes the char- acters used in Cyrillic scripts. CP 1251 characters The following table displays the characters in CP 1251 that are printable and unlisted in the ascii(7) manual page. Oct Dec Hex Char Description ------------------------------------------------------------------------ 200 128 80 CYRILLIC CAPITAL LETTER DJE 201 129 81 CYRILLIC CAPITAL LETTER GJE 202 130 82 , SINGLE LOW-9 QUOTATION MARK 203 131 83 CYRILLIC SMALL LETTER GJE 204 132 84 ,, DOUBLE LOW-9 QUOTATION MARK 205 133 85 HORIZONTAL ELLIPSIS 206 134 86 - DAGGER 207 135 87 = DOUBLE DAGGER 210 136 88 EUR EURO SIGN 211 137 89 %o PER MILLE SIGN 212 138 8A CYRILLIC CAPITAL LETTER LJE 213 139 8B < SINGLE LEFT-POINTING ANGLE QUOTATION MARK 214 140 8C CYRILLIC CAPITAL LETTER NJE 215 141 8D CYRILLIC CAPITAL LETTER KJE 216 142 8E CYRILLIC CAPITAL LETTER TSHE 217 143 8F CYRILLIC CAPITAL LETTER DZHE 220 144 90 CYRILLIC SMALL LETTER DJE 221 145 91 ' LEFT SINGLE QUOTATION MARK 222 146 92 ' RIGHT SINGLE QUOTATION MARK 223 147 93 " LEFT DOUBLE QUOTATION MARK 224 148 94 " RIGHT DOUBLE QUOTATION MARK 225 149 95 o BULLET 226 150 96 - EN DASH 227 151 97 -- EM DASH 230 152 98 UNDEFINED 231 153 99 tm TRADE MARK SIGN 232 154 9A CYRILLIC SMALL LETTER LJE 233 155 9B > SINGLE RIGHT-POINTING ANGLE QUOTATION MARK 234 156 9C CYRILLIC SMALL LETTER NJE 235 157 9D CYRILLIC SMALL LETTER KJE 236 158 9E CYRILLIC SMALL LETTER TSHE 237 159 9F CYRILLIC SMALL LETTER DZHE 240 160 A0 NO-BREAK SPACE 241 161 A1 CYRILLIC CAPITAL LETTER SHORT U 242 162 A2 CYRILLIC SMALL LETTER SHORT U 243 163 A3 CYRILLIC CAPITAL LETTER JE 244 164 A4 x CURRENCY SIGN 245 165 A5 CYRILLIC CAPITAL LETTER GHE WITH UPTURN 246 166 A6 | BROKEN BAR 247 167 A7 S SECTION SIGN 250 168 A8 CYRILLIC CAPITAL LETTER IO 251 169 A9 (C) COPYRIGHT SIGN 252 170 AA CYRILLIC CAPITAL LETTER UKRAINIAN IE 253 171 AB << LEFT-POINTING DOUBLE ANGLE QUOTATION MARK 254 172 AC ~ NOT SIGN 255 173 AD SOFT HYPHEN 256 174 AE (R) REGISTERED SIGN 257 175 AF CYRILLIC CAPITAL LETTER YI 260 176 B0 o DEGREE SIGN 261 177 B1 +- PLUS-MINUS SIGN 262 178 B2 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I 263 179 B3 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I 264 180 B4 CYRILLIC SMALL LETTER GHE WITH UPTURN 265 181 B5 u MICRO SIGN 266 182 B6 9| PILCROW SIGN 267 183 B7 . MIDDLE DOT 270 184 B8 CYRILLIC SMALL LETTER IO 271 185 B9 NUMERO SIGN 272 186 BA CYRILLIC SMALL LETTER UKRAINIAN IE 273 187 BB >> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK 274 188 BC CYRILLIC SMALL LETTER JE 275 189 BD CYRILLIC CAPITAL LETTER DZE 276 190 BE CYRILLIC SMALL LETTER DZE 277 191 BF CYRILLIC SMALL LETTER YI 300 192 C0 CYRILLIC CAPITAL LETTER A 301 193 C1 CYRILLIC CAPITAL LETTER BE 302 194 C2 CYRILLIC CAPITAL LETTER VE 303 195 C3 CYRILLIC CAPITAL LETTER GHE 304 196 C4 CYRILLIC CAPITAL LETTER DE 305 197 C5 CYRILLIC CAPITAL LETTER IE 306 198 C6 CYRILLIC CAPITAL LETTER ZHE 307 199 C7 CYRILLIC CAPITAL LETTER ZE 310 200 C8 CYRILLIC CAPITAL LETTER I 311 201 C9 CYRILLIC CAPITAL LETTER SHORT I 312 202 CA CYRILLIC CAPITAL LETTER KA 313 203 CB CYRILLIC CAPITAL LETTER EL 314 204 CC CYRILLIC CAPITAL LETTER EM 315 205 CD CYRILLIC CAPITAL LETTER EN 316 206 CE CYRILLIC CAPITAL LETTER O 317 207 CF CYRILLIC CAPITAL LETTER PE 320 208 D0 CYRILLIC CAPITAL LETTER ER 321 209 D1 CYRILLIC CAPITAL LETTER ES 322 210 D2 CYRILLIC CAPITAL LETTER TE 323 211 D3 CYRILLIC CAPITAL LETTER U 324 212 D4 CYRILLIC CAPITAL LETTER EF 325 213 D5 CYRILLIC CAPITAL LETTER HA 326 214 D6 CYRILLIC CAPITAL LETTER TSE 327 215 D7 CYRILLIC CAPITAL LETTER CHE 330 216 D8 CYRILLIC CAPITAL LETTER SHA 331 217 D9 CYRILLIC CAPITAL LETTER SHCHA 332 218 DA CYRILLIC CAPITAL LETTER HARD SIGN 333 219 DB CYRILLIC CAPITAL LETTER YERU 334 220 DC CYRILLIC CAPITAL LETTER SOFT SIGN 335 221 DD CYRILLIC CAPITAL LETTER E 336 222 DE CYRILLIC CAPITAL LETTER YU 337 223 DF CYRILLIC CAPITAL LETTER YA 340 224 E0 CYRILLIC SMALL LETTER A 341 225 E1 CYRILLIC SMALL LETTER BE 342 226 E2 CYRILLIC SMALL LETTER VE 343 227 E3 CYRILLIC SMALL LETTER GHE 344 228 E4 CYRILLIC SMALL LETTER DE 345 229 E5 CYRILLIC SMALL LETTER IE 346 230 E6 CYRILLIC SMALL LETTER ZHE 347 231 E7 CYRILLIC SMALL LETTER ZE 350 232 E8 CYRILLIC SMALL LETTER I 351 233 E9 CYRILLIC SMALL LETTER SHORT I 352 234 EA CYRILLIC SMALL LETTER KA 353 235 EB CYRILLIC SMALL LETTER EL 354 236 EC CYRILLIC SMALL LETTER EM 355 237 ED CYRILLIC SMALL LETTER EN 356 238 EE CYRILLIC SMALL LETTER O 357 239 EF CYRILLIC SMALL LETTER PE 360 240 F0 CYRILLIC SMALL LETTER ER 361 241 F1 CYRILLIC SMALL LETTER ES 362 242 F2 CYRILLIC SMALL LETTER TE 363 243 F3 CYRILLIC SMALL LETTER U 364 244 F4 CYRILLIC SMALL LETTER EF 365 245 F5 CYRILLIC SMALL LETTER HA 366 246 F6 CYRILLIC SMALL LETTER TSE 367 247 F7 CYRILLIC SMALL LETTER CHE 370 248 F8 CYRILLIC SMALL LETTER SHA 371 249 F9 CYRILLIC SMALL LETTER SHCHA 372 250 FA CYRILLIC SMALL LETTER HARD SIGN 373 251 FB CYRILLIC SMALL LETTER YERU 374 252 FC CYRILLIC SMALL LETTER SOFT SIGN 375 253 FD CYRILLIC SMALL LETTER E 376 254 FE CYRILLIC SMALL LETTER YU 377 255 FF CYRILLIC SMALL LETTER YA NOTES
CP 1251 is also known as Windows Cyrillic. SEE ALSO
ascii(7), charsets(7), cp1252(7), iso_8859-5(7), koi8-r(7), koi8-u(7), utf-8(7) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2016-07-17 CP1251(7)
All times are GMT -4. The time now is 08:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy