Sponsored Content
Full Discussion: How to fix this awk
Top Forums Shell Programming and Scripting How to fix this awk Post 302430316 by Franklin52 on Thursday 17th of June 2010 07:41:17 AM
Old 06-17-2010
Something like this?
Code:
awk -F\* '/^BPR/{$10="XXX" substr($10,4);$16="XXX" substr($16,4)}1' OFS="*" file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk / shell - Fix broken lines and data

Gurus, I am struggling with a issue and thought I could use some of your expertise. Need Help with this I have a flat file that has millions of records 24|john|account ~ info |56| 25|kuo|account ~ journal |58| 27|kim|account ~ journal |59| 28|San|account ~ journal |60|... (3 Replies)
Discussion started by: rimss
3 Replies

2. Shell Programming and Scripting

AWK record length fix

Hi Friends, Need some help in AWK. Working on AIX 5 Have been trying the following functionality to make the record length fixed: if( length(record) < 300 ) { printf("%-300s\n", record); } In my opinion it will apply some fillers in the end. Its is not making any... (4 Replies)
Discussion started by: kanu_pathak
4 Replies

3. Solaris

ZFS Help!!! Can I fix this??

Well I got ZFS going almost in version one and didn't have the money to raid it or mirror it. I run off of 7 - 750GB-1TB USB drives and it's run great for over a year. Recently I needed to power off and move some stuff around and when I powered it back on I got this:... (3 Replies)
Discussion started by: lacakid
3 Replies

4. Shell Programming and Scripting

how to fix this awk script?

i have a log file while looks like this ++ user_a blabla blabla nas_b blabla user_d this is a user_a junk line another junk line user_c nas_m blabla ++ basically most of the lines contain a "user" keywords, and the rest of the lines do not have "user" at all. So I have the... (17 Replies)
Discussion started by: fedora
17 Replies

5. Shell Programming and Scripting

how to fix the column length in a file using Awk Prog

Hi I use the following code to read the file and to fix the length of the column of the record in the file 'Sample.txt' ls Samp* | awk ' { a=$1 } END{ FS="n" for(i=1;i<=NR;i++) { while( getline < a ) { f1=$0; print("Line::",f1); f2=substr(f1,1,10) print("Field1::",f2);... (10 Replies)
Discussion started by: meva
10 Replies

6. Shell Programming and Scripting

Fix timestamp with Sed or Awk

Hi I am dealing with the following string: Date: Thur, 13 March 2011 01:01:10 +0000 I asked for help in another topic that converted a similar string: Date: Thur, 13 March 2011 9:50 AM To a 24 hr standard. The problem is that it comes out as: Date: Thur, 13 March 2011 9:50:00 +0000... (4 Replies)
Discussion started by: duonut
4 Replies

7. UNIX for Dummies Questions & Answers

Please help to fix awk script

Good morning, fellows. I would need to ask for your help in editing my awk script. Here is the original version: BEGIN { printf ("CRYST1 200.000 200.000 200.000 90.00 90.00 90.00 P 1 1\n") maxatoms=1000 natom=0 found_struct = 0 found_bond = 0 } { if( NF == 5 ) { foundff=0 natom++... (9 Replies)
Discussion started by: snysmumrik
9 Replies

8. Shell Programming and Scripting

Help me please to fix my error

Can you help me to fix my error please?! I checked the code and I think there is no mistake, but when I run it gives me error such line 1: /Users/Manu/trials/hosts: is a directory sort: open failed: /Users/Manu/trials/hosts/*: No such file or directory Help me please... mycode NAME value.... (9 Replies)
Discussion started by: Manu1234567
9 Replies

9. Shell Programming and Scripting

awk if condition match and fix print decimal place

Hi All, I have problem in the middle of implementing to users, whereby the complaint is all about the decimal place which is too long. I need two decimal places only, but the outcome from command is always fixed to 6. See the sample : before: Sort Total Site Sort SortName Parts ... (3 Replies)
Discussion started by: horsepower
3 Replies

10. UNIX for Dummies Questions & Answers

awk file subtracted by a fix value - conditioned

Hi all... i have been trying to make this work but I have been failing for 6 hours .. I know it should be something simple that I am missing to it would be great if you can help me ... I want to subtract a fixed value (lets set 1) from any value >=1 from the whole file my file looks like ... (4 Replies)
Discussion started by: A-V
4 Replies
PERLKO(1)						 Perl Programmers Reference Guide						 PERLKO(1)

X XXX perldocX XX XX XX XX XX XXXX X XXX XXX XXXX XX XX =head, =item, 'L' XX XXXXXX.  X XXX XX perldocX XX XX XXXX XXX X XXX XX POD XXXX XX XXXX.
X XXX XX perlpod XXXX XXXXXX.

NAME
perlko - PerlX XXX XXX DESCRIPTION
PerlX XXX XX XX XXXXX ! PerlX 5.8.0XXX XXXX/ISO 10646X XX XXXX XXX XXX. XXXX XXX XXXX XXXX XXX XX XXXX XXXX XXX XX XXX XXX XX XXX XX XXX XXXX XXXXX. XXXXX X XXXX XXX XX XXX XX XX XX - XXX XX XXX, XX XXX, XXX XXX, XXX XX XXXX XXX XX XXXX, XX XX, XXX XX, XXXX XX, XXXX XX, XXXX XX, XX XXXX XX XX X-X XXXX XX XXX XX XX XXX XXX XXX X XX X XX XXX XX XXX XXX XX XXX XXXX X X XX XX XXX XXXX XX XX XXXX XXXX XX XX XX XX XXX XXXX XXXX. PerlX XXXXX XXXXX XX XXX XX XXXXX. XX XXXXX XXX Perl XXXX XXX UTF-8 XXXX X X XX, XX XXX XXX(XX XX, XXX, index, substr)X XXX XX XX XXXX XX XXX XXXXX. (X XXX XX perlunicode XXXX XXXXXX.) XXXXX XX XXXX XX XX XXX XXX, XXX XX XXX XX XX/X XXX XXXXX XXXX XX XX XXXXX X XXXX XXX XXX XX XX XX 'Encode'X XXXXX. XXXX 'Encode'X XX XXX XXX XXX XXX XX X X XXXX. 'Encode'X XXX XX XXX XXXX XXXXX. o euc-kr US-ASCIIX KS X 1001X XX XX XXXXX XXX (XX XXXXXX XX.) KS X 2901X RFC 1557 XX. o cp949 MS-Windows 9x/MEXX XXX XX XXX. euc-krX 8,822XX XX XXX XX XX. aliasX uhc, windows-949, x-windows-949, ks_c_5601-1987. X XXX XXX XXXX XX XXXXX, Microsoft XXXX CP949X XXX XXX XX. o johab KS X 1001:1998 XX 3XX XXX XXX. XX XXXXX cp949X XXXXX US-ASCIIX KS X 1001X 8,822XX XX XXX XX XX. XXX XXX XX XX. o iso-2022-kr RFC 1557XX XXX XXX XXX XX XXX XXXXX US-ASCIIX KS X 1001X XXXXX XX XXX euc-krX XXX XXX XXX XX. 1997-8X XXX XXXX X XX XX XXX XXX XX. o ksc5601-raw KS X 1001(KS C 5601)X GL(X, MSBX 0XX X XX) X XXX XX XXX. US-ASCIIX XXXX XX XXXX XXX XX X11 XXX XX XXX (ksc5601.1987-0. '0'X GLX XXX.)XX XXX XX XXXXX XX XX. KS C 5601X 1997X KS X 1001X XXX XXXX. 1998XXX X XX (XXX XXX XX XX XX)X XXXX. X XX XX XXX XXX XXXX. XX XX, euc-kr XXXXX X XXX UTF-8X XXXXX XXX XX XX XXX. perl -Mencoding=euc-kr,STDOUT,utf8 -pe1 < file.euckr > file.utf8 XXXX XXX XX X X XXXX. perl -Mencoding=utf8,STDOUT,euc-kr -pe1 < file.utf8 > file.euckr XX XXX XX XXXX X X XXX Encode XXX XX XXXX PerlXX XX piconvX PerlX XX XXXX. X XXXX X X XXX piconvX UnixX XX iconvX XXX X XXXX. X XXXX XXX XXXX. piconv -f euc-kr -t utf8 < file.euckr > file.utf8 piconv -f utf8 -t euc-kr < file.utf8 > file.euckr X, 'PerlIO::encoding' XXX XX XXX XXXX XXX XX XX (XXX XXX XXX) XXX XX X X XXXX. #!/path/to/perl use encoding 'euc-kr', STDIN => 'euc-kr', STDOUT-> 'euc-kr', STDERR=>'euc-kr'; print length("XX"); # 2 (X XXXX XX XX XXX XX) print length('XX'); # 4 (XX XXXX XXX XX XXX XX) print index("XX, XXX", "X"); # -1 ('X'X XX) print index('XX, XXX', 'X'); # 7 (8XXX 9XX XXXX 'X'X XXXX XXX.) X XXX XX XXX... PerlX XXXX XXX XXX XXX XX XX XX, X XXX XX Perl XX X XXX XXXX XX, EncodeX XXX XX XX XX XX X XXXX. XX X XXX XX XX XXX XX XXXX. Perl XX XX XXX XXX XX XXX XXX XX XXX XXXX. X XXX XX XXX XX XXX XX XXXX XX XX XXXX. <http://www.perl.com/> O'ReillyX Perl X XXX <http://www.cpan.org/> Comprehensive Perl Archive Network <http://lists.perl.org/> Perl XXX XXX. XX XXX XXX perl-unicodeXX 'Encode'X XX XXX. PerlX X XX XXXXX XXX X X XX XXX XX XXX <http://www.perl.or.kr/> Perl XX XXX XX <news:han.comp.lang.perl/> XXX Perl XX XX <http://www.hanb.co.kr/search/searchResult.html?keyword=perl> O'ReillyXX XX XXX Perl XX XX <http://www.perlschool.net/> Perl XX XX X XX, XX XX, XX XX XXX XX <http://www.perl.co.kr> PerlX XXX CGI, DB, XX XX XX XX X XX XX XXXX X XXX XXX XX XX <http://www.unicode.org/> XXXX XXXX. <http://std.dkuug.dk/JTC1/SC2/WG2> XXXXX UnicodeX XX ISO XXX ISO/IEC 10646 UCS(Universal Character Set)X XXX ISO/IEC JTC1/SC2/WG2X X XXX. <http://www.cl.cam.ac.uk/~mgk25/unicode.html> XXX/XXXXX XXXXX UTF-8 XXX XX XXX(FAQ) <http://wiki.kldp.org/Translations/html/UTF8-Unicode-KLDP/UTF8-Unicode-KLDP.html> XXX/XXXXX XXXXX UTF-8 XXX XX XXX(FAQ)X XXX XX SEE ALSO
Encode, Encode::KR, encoding, perluniintro, perlunicode AUTHORS
Jarkko Hietaniemi <jhi@iki.fi> XXX <jshin@mailaps.org> perl v5.18.2 2014-01-06 PERLKO(1)
All times are GMT -4. The time now is 01:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy