Sponsored Content
Full Discussion: Format in AWK please
Top Forums Shell Programming and Scripting Format in AWK please Post 302530161 by ygemici on Monday 13th of June 2011 06:46:32 AM
Old 06-13-2011
I update vasanth's solution
Code:
# awk -F':' '/^details/{split($0, a, "=")};  /^class/{b=$2} /^adress/{print a[1]"="b" ="$2}' file1
details of them = 5th_needed = address_needed

This User Gave Thanks to ygemici For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

data format from (4.56 0.7) -> 4.6(7) awk?!

Hi, I have to manipulate a data file which say reads like this {$index $value $error_on_value} aa 4.56 0.7 bb 123.456 0.00987 cc 987654 321 . . in easily human readable format of type aa 4.6(7) bb 123.456(1) cc 9.877(3)e+05 value rounded to 4.6 with error of 0.7 on the last... (4 Replies)
Discussion started by: ahan
4 Replies

2. Shell Programming and Scripting

AWK CSV to TXT format, TXT file not in a correct column format

HI guys, I have created a script to read 1 column in a csv file and then place it in text file. However, when i checked out the text file, it is not in a column format... Example: CSV file contains name,age aa,11 bb,22 cc,33 After using awk to get first column TXT file... (1 Reply)
Discussion started by: mdap
1 Replies

3. Shell Programming and Scripting

How to format columns using AWK

Hi, How to format something like this: John Roberts 324-141-984 Acct Jack Williams 159-555-555 Acct William Jackson 949-911-888 Acct Mark J Walton 145-852-252 Acct Fred P Milton 483-244-390 Acct Bill P J Miller 404-050-223 Acct into... (12 Replies)
Discussion started by: ora_umair
12 Replies

4. Shell Programming and Scripting

scripting/awk help : awk sum output is not comming in regular format. Pls advise.

Hi Experts, I am adding a column of numbers with awk , however not getting correct output: # awk '{sum+=$1} END {print sum}' datafile 2.15291e+06 How can I getthe output like : 2152910 Thank you.. # awk '{sum+=$1} END {print sum}' datafile 2.15079e+06 (3 Replies)
Discussion started by: rveri
3 Replies

5. Shell Programming and Scripting

awk:How to format a number?

Hello, I need to format a number..like 12900 should be printed as 12,900 and 1209 as 1,209 and so on. (Just like we do in excel). Can this be done in awk. any printf options we have?Please suggest me. Thanks! (8 Replies)
Discussion started by: vijay_0209
8 Replies

6. Shell Programming and Scripting

Format using AWK

Need some help .. in formating some input INPUT FILE IMAGE ap00m43 0 0 8 ap00m43_1318914034 UNIX_STANDARD_ADC_2 0 *NULL* root Daily 1 0 1318914034 408 1319518834 0 HISTO -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 FRAG 1 1 0 0 2 20 6 G11890 ts00p71 65536 FRAG 1 2 13440 0 2 20 7 G11890 ts00p71... (2 Replies)
Discussion started by: greycells
2 Replies

7. Shell Programming and Scripting

awk Format

Guys ,, pls .. need help with this ... File 1 0A6C Not Visible ???:? NA:NA TDEV N/Grp'd NR 5121 0A6D Not Visible ***:* NA:NA TDEV N/Grp'd RW 33784 0A6E Not Visible ***:* NA:NA TDEV N/Grp'd RW 33784... (4 Replies)
Discussion started by: greycells
4 Replies

8. UNIX for Dummies Questions & Answers

Solaris8 = How to format this df -k | awk

Hi, Unfortunately, we still have Solaris 8 to support and it does not support df -h so I am stucked with having to use df -k. UNIX shell is ksh. Example of df -k run is below: $ df -k /db/test01 | awk '{ print }' Filesystem kbytes used avail capacity Mounted on... (2 Replies)
Discussion started by: newbie_01
2 Replies

9. Shell Programming and Scripting

Format a file using awk

I have a file as below empty May7 noread May8 How can process this file and print as below. neat and clean. Filename Date Created empty May7 noread May8 I tried something with printf before creating the file itself... (3 Replies)
Discussion started by: Tuxidow
3 Replies

10. Shell Programming and Scripting

awk incorrect format

I was wondering whether anyone has any idea what is happening here. I'm using simple code to compare 2 tab delimited files based on column 1 values. If the column1 value of file1 exists in file2, then I'm to print the column4 value in file2 in column3 of file1. Here is my code: 1st I have to... (6 Replies)
Discussion started by: Geneanalyst
6 Replies
Locale::Codes::LangFam(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangFam(3pm)

NAME
Locale::Codes::LangFam - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangFam; $lext = code2langfam('apa'); # $lext gets 'Apache languages' $code = langfam2code('Apache languages'); # $code gets 'apa' @codes = all_langfam_codes(); @names = all_langfam_names(); DESCRIPTION
The "Locale::Codes::LangFam" module provides access to standard codes used for identifying language families, such as those as defined in ISO 639-5. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 639-5 language family codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language families. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langfam('apa','alpha'); $lext = code2langfam('apa',LOCALE_LANGFAM_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from ISO 639-5 such as 'apa' for Apache languages. This is the default code set. ROUTINES
code2langfam ( CODE [,CODESET] ) langfam2code ( NAME [,CODESET] ) langfam_code2code ( CODE ,CODESET ,CODESET2 ) all_langfam_codes ( [CODESET] ) all_langfam_names ( [CODESET] ) Locale::Codes::LangFam::rename_langfam ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangFam::add_langfam ( CODE ,NAME [,CODESET] ) Locale::Codes::LangFam::delete_langfam ( CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_alias ( NAME ,NEW_NAME ) Locale::Codes::LangFam::delete_langfam_alias ( NAME ) Locale::Codes::LangFam::rename_langfam_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::delete_langfam_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.loc.gov/standards/iso639-5/id.php ISO 639-5 . AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2012 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-10-11 Locale::Codes::LangFam(3pm)
All times are GMT -4. The time now is 02:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy