Sponsored Content
Top Forums Shell Programming and Scripting Script to append a value seperated by comma Post 302347209 by Tuxidow on Tuesday 25th of August 2009 06:39:50 AM
Old 08-25-2009
I got it...!! Thanks for all your help...!!


Code:
awk -v val='foo' '/hello:123:/ {$0=$0 "," val}1' myFile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Handling .CSV( Comma seperated value) in awk

Hi Guys, I am trying to reading in comma seperated values in awk. I can set the delimiter to be a comma, but the tricky part is that commas that appear within quotes are not to be considered as delimiters. Could someone please help. Regards, Laud (1 Reply)
Discussion started by: Laud12345
1 Replies

2. Shell Programming and Scripting

Comma Seperated List of Values

Hi, I have a comma seperated list of values: export list="red,blue,white,yellow" Given a value in a variable "look", i want to check whether the value is available in the above list. But the result should be based on exact string match and not part of the string. I am using following... (9 Replies)
Discussion started by: brap45
9 Replies

3. Shell Programming and Scripting

change list to comma seperated items

I have a list of servers in a file called serverlist like this server1 server2 server3 i need to have them (with no trailing comma, the program does not like that) server1,server2,server3 so far i have been using HOSTS=/tmp/serverlist HOSTS=${HOSTS:-$(grep -Ev "^#|^$"... (2 Replies)
Discussion started by: insania
2 Replies

4. UNIX for Dummies Questions & Answers

Search and then concat 4m other file (comma seperated)

My query is now a bit simplified. file1.txt names; ID; value1 ; values N; ABC; 1 ; a18 ; ... CDF; 2 ; b16 ; .. ABC; 1 ; c13 ; ...... EFG; 3 ;d12 ; ... file2.txt ID(Unique);smVals; smVal1; smVal N; 1; ...; ...; ...; 2; ..; ..; ..; 3; ..; ..; ..; ... (1 Reply)
Discussion started by: szchmaltz
1 Replies

5. Shell Programming and Scripting

Removing blank lines from comma seperated and space seperated file.

Hi, I want to remove empty/blank lines from comma seperated and space seperated files Thanks all for help (11 Replies)
Discussion started by: pinnacle
11 Replies

6. Shell Programming and Scripting

perl help for comma seperated output

Hi, how can i make a comma seperated output summary. i attached the sample log file. I have to capture these data in the log file. Arcotid Time Stamp, Username, Success, Failure, Error Code, Error Message In the log snippet the userID can be found in- Code Arcot Native Server:... (3 Replies)
Discussion started by: namishtiwari
3 Replies

7. Shell Programming and Scripting

Passing Comma seperated arguments

Hi How to takes coma seperated arguments and and parsing each argument to varaiable that has used further in the script. (1 Reply)
Discussion started by: Reddy482
1 Replies

8. Shell Programming and Scripting

Convert comma seperated file to line seperated.

Hi, I have data like this. 1,2,3,4 Output required: 1 2 3 4 I am trying to use tr function but getting error. Help is appreciated. (6 Replies)
Discussion started by: pinnacle
6 Replies

9. Shell Programming and Scripting

Need Help in rearranging the content of a file comma seperated

I have a file with the below content a = test1 b = test2 a = test3 b= test4 c = test6 b = test5 d = test7 d = test9 Need the output to be as follows a = test1,test3 b = test2, test5 c = test6 d = test7, test9 (4 Replies)
Discussion started by: iron_michael86
4 Replies

10. Shell Programming and Scripting

awk comma seperated value within double quote

Hi, I have a data file separated by comma, data enclosed by "" head file.txt "HD","Sep 13 2016 1:05AM","0001" "DT","273093045","192534" "DT","273097637","192534" .. I want to get the 3rd column value (0001) to be assigned to my variable I tried FILE_VER=`cat file.txt | awk... (2 Replies)
Discussion started by: Prasannag87
2 Replies
CamlinternalOO(3o)						   OCaml library						CamlinternalOO(3o)

NAME
CamlinternalOO - Run-time support for objects and classes. Module Module CamlinternalOO Documentation Module CamlinternalOO : sig end Run-time support for objects and classes. All functions in this module are for system use only, not for the casual user. === Classes === type tag type label type table type meth type t type obj type closure val public_method_label : string -> tag val new_method : table -> label val new_variable : table -> string -> int val new_methods_variables : table -> string array -> string array -> label array val get_variable : table -> string -> int val get_variables : table -> string array -> int array val get_method_label : table -> string -> label val get_method_labels : table -> string array -> label array val get_method : table -> label -> meth val set_method : table -> label -> meth -> unit val set_methods : table -> label array -> unit val narrow : table -> string array -> string array -> string array -> unit val widen : table -> unit val add_initializer : table -> (obj -> unit) -> unit val dummy_table : table val create_table : string array -> table val init_class : table -> unit val inherits : table -> string array -> string array -> string array -> t * (table -> obj -> Obj.t) * t * obj -> bool -> Obj.t array val make_class : string array -> (table -> Obj.t -> t) -> t * (table -> Obj.t -> t) * (Obj.t -> t) * Obj.t type init_table val make_class_store : string array -> (table -> t) -> init_table -> unit val dummy_class : string * int * int -> t * (table -> Obj.t -> t) * (Obj.t -> t) * Obj.t === Objects === val copy : (< .. > as 'a) -> 'a val create_object : table -> obj val create_object_opt : obj -> table -> obj val run_initializers : obj -> table -> unit val run_initializers_opt : obj -> obj -> table -> obj val create_object_and_run_initializers : obj -> table -> obj val send : obj -> tag -> t val sendcache : obj -> tag -> t -> int -> t val sendself : obj -> label -> t val get_public_method : obj -> tag -> closure === Table cache === type tables val lookup_tables : tables -> closure array -> tables === Builtins to reduce code size === type impl = | GetConst | GetVar | GetEnv | GetMeth | SetVar | AppConst | AppVar | AppEnv | AppMeth | AppConstConst | AppConstVar | AppConstEnv | AppConstMeth | AppVarConst | AppEnvConst | AppMethConst | MethAppConst | MethAppVar | MethAppEnv | MethAppMeth | SendConst | SendVar | SendEnv | SendMeth | Closure of closure === Parameters === type params = { mutable compact_table : bool ; mutable copy_parent : bool ; mutable clean_when_copying : bool ; mutable retry_count : int ; mutable bucket_small_size : int ; } val params : params === Statistics === type stats = { classes : int ; methods : int ; inst_vars : int ; } val stats : unit -> stats OCamldoc 2012-06-26 CamlinternalOO(3o)
All times are GMT -4. The time now is 03:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy