Sponsored Content
Top Forums Shell Programming and Scripting fill a NIL into the blank field Post 302111850 by dennis.jacob on Friday 23rd of March 2007 03:47:35 AM
Old 03-23-2007
Give a try on thsi..
Quote:
sed -e "s/,,/,NIL,/g" filename | awk -F"," 'BEGIN {OFS=",";}{ if($11==0) { $11=$11":00"} print }' >temp
mv temp filename
Output:
45111,40404,peter,NIL,0303403,0,030304,john,NIL,9,0:00,

Last edited by dennis.jacob; 03-23-2007 at 04:56 AM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk: How to check if field is blank?

In awk, I'd like to check if a field is blank. And by blank I mean, the field could be "" or " " In other words, the field could either be empty, or be filled with spaces. Would the regex look like this? $5 ~ // { Action }? What other ways are there? Hmm.. in any case I think... (7 Replies)
Discussion started by: yongho
7 Replies

2. Shell Programming and Scripting

how to include field separator if there are blank fields?

Hi, I have the following data in the format as shown (note: there are more than 1 blank spaces between each field and the spaces are not uniform, meaning there can be one blank space between field1 and field2 and 3 spaces between field3 and field4, in this example, # are the spaces in between... (19 Replies)
Discussion started by: ReV
19 Replies

3. Programming

Zero Fill 10 position field

Hi everyone, I am using shell scripting on a Unix SCO box. It calls a C program named zerofill. I do not know anything about C. I am having an issue with a hash total that should only be zero filled 10 positions but the record has 11 positions. DEBUG RESULTS + nice -n -5 bc -l /tmp/fhash8395... (0 Replies)
Discussion started by: ski
0 Replies

4. Shell Programming and Scripting

Fill the empty line by adding line before blank line

FIle A "A" 2 aa 34 3 ac 5 cd "B" 3 hu 67 4 fg 5 gy output shud be A"" 2 aa 34 "A" 3 ac 34 "A" 5 cd 34 "B" 3 hu 67 "B" 4 fg 67 "B" 5 gy 67 (6 Replies)
Discussion started by: cdfd123
6 Replies

5. Shell Programming and Scripting

Find and replace blank in the last field

Hi all, I have a huge file and I need to get ride of the fields 6-11 and replace the blanks in field 5 with a missing value(99999). 159,93848,5354,343,67898,45,677,5443,434,5545,45 677,45545,3522,244, 554,54344,3342,456, 344,43443,2344,444,23477... (12 Replies)
Discussion started by: GoldenFire
12 Replies

6. Shell Programming and Scripting

Help with removal of blank spaces from the second field!

Hi everyone.. I'm trying to eliminate multiple whitespaces from a file.. I must make use of shell script to eliminate whitespaces.. Take a look at the sample file 1 int main() 2 { 3 int a,b; 4 printf("Enter the values of a and b"); 5 scanf("%d%d",&a,&b); 6 if(a>b) ... (6 Replies)
Discussion started by: abk07
6 Replies

7. Shell Programming and Scripting

Adding an additional blank field to a file

Hi, I have the following file, I'd like to add an additional blank field to this file This is a tab delimited file, I have tried the same thing on excel, but looking for a unix solution. Here is my input: Country Postal Admin4 StreetBaseName StreetType HUN 2243 Kóka Dózsa György ... (3 Replies)
Discussion started by: ramky79
3 Replies

8. Shell Programming and Scripting

Find a blank field

Find a blank field Hi I have set of fields that have some blank values, how to find that and get its line noumbers in output file. Ex: Col1 col2 col3 11 ss 103 12 104 13 105 14 se 106 (2 Replies)
Discussion started by: Shenbaga.d
2 Replies

9. Shell Programming and Scripting

Find a blank field and replace values to NA

Hi All, i have a file like col1 col2 col3 13 24 NA 12 13 14 11 12 13 14 22 NA 18 26 NA in this file if i found "NA" other values in the line are also replace by NA Could you help me! (7 Replies)
Discussion started by: Shenbaga.d
7 Replies
CosNotifyChannelAdmin_ProxySupplier(3erl)		     Erlang Module Definition			 CosNotifyChannelAdmin_ProxySupplier(3erl)

NAME
CosNotifyChannelAdmin_ProxySupplier - This module implements the OMG CosNotifyChannelAdmin::ProxySupplier interface. DESCRIPTION
To get access to the record definitions for the structures use: -include_lib("cosNotification/include/*.hrl"). This module also exports the functions described in: * CosNotification_QoSAdmin * CosNotifyFilter_FilterAdmin EXPORTS
_get_MyType(ProxySupplier) -> ProxyType Types ProxySupplier = #objref ProxyType = 'PUSH_ANY' | 'PULL_ANY' | 'PUSH_STRUCTURED' | 'PULL_STRUCTURED' | 'PUSH_SEQUENCE' | 'PULL_SEQUENCE' This readonly attribute maintains the enumerant describing the which type the target object is. _get_MyAdmin(ProxySupplier) -> AdminObject Types ProxySupplier = #objref AdminObject = #objref This readonly attribute maintains the admin's reference which created the target object. _get_priority_filter(ProxySupplier) -> MappingFilter Types ProxySupplier = #objref MappingFilter = #objref This operation returns the associated priority MappingFilter. If no such object exist a NIL reference is returned. _set_priority_filter(ProxySupplier, MappingFilter) -> ok Types ProxySupplier = #objref MappingFilter = #objref This operation associate a new priority MappingFilter with the target object. _get_lifetime_filter(ProxySupplier) -> MappingFilter Types ProxySupplier = #objref MappingFilter = #objref This operation returns the associated lifetime MappingFilter. If no such object exist a NIL reference is returned. _set_lifetime_filter(ProxySupplier, MappingFilter) -> ok Types ProxySupplier = #objref MappingFilter = #objref This operation associate a new lifetime MappingFilter with the target object. obtain_offered_types(ProxySupplier, ObtainInfoMode) -> EventTypeSeq Types ProxySupplier = #objref ObtainInfoMode = 'ALL_NOW_UPDATES_OFF' | 'ALL_NOW_UPDATES_ON' | 'NONE_NOW_UPDATES_OFF' | 'NONE_NOW_UPDATES_ON' EventTypeSeq = [EventType] EventType = #'CosNotification_EventType'{domain_name, type_name} domain_name = type_name = string() Depending on the input parameter ObtainInfoMode , this operation may return a sequence of the EventTypes the target object is inter- ested in receiving. If 'ALL_NOW_UPDATES_OFF' or 'ALL_NOW_UPDATES_ON' is given a sequence will be returned, otherwise not. If 'ALL_NOW_UPDATES_OFF' or 'NONE_NOW_UPDATES_OFF' are issued the target object will not inform the associated NotifySubscribe object when an update occurs. 'ALL_NOW_UPDATES_ON' or 'NONE_NOW_UPDATES_ON' will result in that update information will be sent. validate_event_qos(ProxySupplier, QoSProperties) -> Reply Types ProxySupplier = #objref QoSProperties = [QoSProperty] QoSProperty = #'CosNotification_Property'{name, value} name = string() value = #any Reply = {ok, NamedPropertyRangeSeq} | {'EXCEPTION', CosNotification_UnsupportedQoS{qos_err}} NamedPropertyRangeSeq = [NamedPropertyRange] NamedPropertyRange = #CosNotification_NamedPropertyRange{name, range} name = string() range = #CosNotification_PropertyRange{low_val, high_val} low_val = #any high_val = #any qos_err = PropertyErrorSeq PropertyErrorSeq = [PropertyError] PropertyError = #'CosNotification_PropertyError'{code, name, available_range} code = 'UNSUPPORTED_PROPERTY' | 'UNAVAILABLE_PROPERTY' | 'UNSUPPORTED_VALUE' | 'UNAVAILABLE_VALUE' | 'BAD_PROPERTY' | 'BAD_TYPE' | 'BAD_VALUE' name = string() available_range = PropertyRange PropertyRange = #CosNotification_PropertyRange{low_val, high_val} low_val = high_val = #any To check if certain Quality of Service properties can be added to events in the current context of the target object this operation should be used. If we cannot support the required settings an exception describing why will be raised. Ericsson AB cosNotification 1.1.16 CosNotifyChannelAdmin_ProxySupplier(3erl)
All times are GMT -4. The time now is 07:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy