Sponsored Content
Top Forums Shell Programming and Scripting awk - treating remaining columns as one Post 302731197 by ctsgnb on Wednesday 14th of November 2012 12:07:34 PM
Old 11-14-2012
Quote:
Originally Posted by only4satish
could you please explain how does the below code works ?

sub(FS,RS); sub(FS,RS)
sub(FS,RS) substitue the Field Separator (whose default value is a space " ") with a Record Separator (whose default value is a newline "\n")

It does this substitution only once , so the first FS met is changed into a RS.
That is the reason why it is important to make sure that the first FS encountered is one between the fist field $1 and second field $2.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

treating special chars

Hi, I need some advise on treating non printable chars over ascii value 126 Case 1 : On some fields in the text , I need to retiain then 'as-is' and load to a database.I understand it also depends on database codepage. but i just wanna know how do i ensure it do not change while loading... (1 Reply)
Discussion started by: braindrain
1 Replies

2. Shell Programming and Scripting

TRAP treating

Hi, I'm looking for a script that receives the traps from a windows machine and treate them. For exemple just write a line in a file on UNIX server. Can you help me ? Thank you. (2 Replies)
Discussion started by: big123456
2 Replies

3. Shell Programming and Scripting

Treating Strings with spaces

I have a file list.txt which has a list of file names with spaces between the file names like /emptydir/file 1 how do i browse through the list.txt displaying the filenames. Almost all the file names in list.txt have space between them.This file list.txt is formed by using the find statement to... (5 Replies)
Discussion started by: kinny
5 Replies

4. Shell Programming and Scripting

Treating string as date ?

Is there a way to treat a string as date and compare it to the current date? lets assum inpu lik $ cat myfile Name Last login ************************** Sara 2/13/2012 kalpeer 2/15/2012 ygemici 2/14/2012 we want to display the name who logged in during the last #... (4 Replies)
Discussion started by: Sara_84
4 Replies

5. Shell Programming and Scripting

treating multiple delimiters[solved]

Hi, I need to display the last column value in the below o/p. sam2 PS 03/10/11 0 441 Unable to get o/p with this awk code awk -F"+" '{ print $4 }' pwdchk.txt I need to display 441(in this eg.) and also accept it as a variable to treat it with if condition and take a decision.... (1 Reply)
Discussion started by: sam_bd
1 Replies

6. Shell Programming and Scripting

Comparison treating strings as zero integers

I'm trying to write a bash script to perform basic arithmetic operations but I want to run a comparison on the arguments first to check that they're a number greater than zero. I want an error to pop up if the arguments args aren't >= 0 so I have: if ! ]; then echo "bad number: $1" fi ... (14 Replies)
Discussion started by: TierAngst
14 Replies

7. Shell Programming and Scripting

awk treating variables differently in UNIX-Linux

Hi, awk seem to be acting differently in Unix and Linux when it comes to formatting. This is making it difficult to migrate scripts. for example: UNIX: echo "123" |awk '{printf ("%05s\n" ,$1)}' 00123 echo "123" |awk '{printf ("%05d\n" ,$1)}' 00123 echo "S12" |awk '{printf ("%05s\n"... (9 Replies)
Discussion started by: wanderingmind16
9 Replies

8. Shell Programming and Scripting

AIX to RHEL migration - awk treating 0e[0-9]+ as 0 instead of string issue

Greetings Experts, We are migrating from AIX to RHEL Linux. I have created a script to verify and report the NULLs and SPACEs in the key columns and duplicates on key combination of "|" delimited set of big files. Following is the code that was successfully running in AIX. awk -F "|" 'BEGIN {... (5 Replies)
Discussion started by: chill3chee
5 Replies

9. Shell Programming and Scripting

Awk: duplicate column and print remaining as is

Hello there I'd like to make a copy of 2nd column and have it printed in place of column 1. Remaining columns are needed as it. test data: ProbeSet GeneSymbol X22565285 X22566285 ILMN_1050008 MYOCD 6.577 7.395 ILMN_1050014 GPRC6A 6.595 6.668 ILMN_1050017 ... (2 Replies)
Discussion started by: genome
2 Replies
fribidi_get_type(3)						Programmer's Manual					       fribidi_get_type(3)

NAME
fribidi_get_type - get character bidi type SYNOPSIS
#include <fribidi.h> FriBidiCharType fribidi_get_type(FriBidiChar ch); PARAMETERS
FriBidiChar ch Input character. DESCRIPTION
Deprecated. Replaced by fribidi_get_bidi_type. RETURNS
Possible values for a FriBidiCharType are as follows: FRIBIDI_TYPE_LTR Left-To-Right letter. FRIBIDI_TYPE_RTL Right-To-Left letter. FRIBIDI_TYPE_AL Arabic Letter. FRIBIDI_TYPE_EN European Numeral. FRIBIDI_TYPE_AN Arabic Numeral. FRIBIDI_TYPE_ES European number Separator. FRIBIDI_TYPE_ET European number Terminator. FRIBIDI_TYPE_CS Common Separator. FRIBIDI_TYPE_NSM Non Spacing Mark. FRIBIDI_TYPE_BN Boundary Neutral. FRIBIDI_TYPE_BS Block Separator. FRIBIDI_TYPE_SS Segment Separator. FRIBIDI_TYPE_WS WhiteSpace. FRIBIDI_TYPE_ON Other Neutral. FRIBIDI_TYPE_LRE Left-to-Right Embedding. FRIBIDI_TYPE_RLE Right-to-Left Embedding. FRIBIDI_TYPE_LRO Left-to-Right Override. FRIBIDI_TYPE_RLO Right-to-Left Override. FRIBIDI_TYPE_PDF Pop Directional Flag. SEE ALSO
fribidi_charset_to_unicode(3), fribidi_unicode_to_charset(3), fribidi_parse_charset(3), fribidi_shape_arabic(3), fribidi_get_par_direc- tion(3), fribidi_get_par_embedding_levels(3), fribidi_reorder_line(3), fribidi_get_bidi_type(3), fribidi_get_bidi_types(3), fribidi_get_bidi_type_name(3), fribidi_debug_status(3), fribidi_mirroring_status(3), fribidi_set_mirroring(3), fribidi_reorder_nsm_sta- tus(3), fribidi_set_reorder_nsm(3), fribidi_log2vis_get_embedding_levels(3), fribidi_get_type_internal(3), fribidi_remove_bidi_marks(3), fribidi_log2vis(3), fribidi_join_arabic(3), fribidi_get_joining_type(3), fribidi_get_joining_types(3), fribidi_get_joining_type_name(3), fribidi_get_mirror_char(3), fribidi_shape_mirroring(3), fribidi_shape(3) GNU FriBidi 0.19.3 25 August 2012 fribidi_get_type(3)
All times are GMT -4. The time now is 01:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy