Sponsored Content
Full Discussion: how to put it in a column
Top Forums Shell Programming and Scripting how to put it in a column Post 302374076 by bombcan on Monday 23rd of November 2009 10:39:29 AM
Old 11-23-2009
Thanks Guys much appreciated
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Put raw data to column data

Dear all, I want below data to make it in column format.so i will see the data like this cdrID teleServiceCode chargedPartyNumber ... ... ... ... "egmailcom0w10ggzx00" 'sMS (5)' "716323770" "m17ifi5z30w0z6o7200" 'sMS (5)' ... (7 Replies)
Discussion started by: Nayanajith
7 Replies

2. Shell Programming and Scripting

put double quotes for a column

Hi, I have a file which looks like this, I have stripped most of the columns: 2006,UCA,"02452","NM","1","M","84",123,aa 2006,UCA,"02452","NM","1","L","84",123,bb 2006,UCA,"02452","NM","1","L","84",432,cc 2006,UCA,"02452","NM","1","L","33",213,dd 2006,UCA,"02452","NM","1","L","33",124,ee... (3 Replies)
Discussion started by: sumeet
3 Replies

3. Shell Programming and Scripting

Grep strings from file and put in Column

Dear Experts, My file contains below- GET:SUB:ISI,432350414557432; RESP:0:MD,019352020633:ISI,432350414557432:T11,1:T21,1:T22,1:B16,1:T62,1:BAIC,0:BAOC,1:BOIC,0:BIRO,0:BORO,0:PAID,1; GET:SUB:ISI,432350414581060;... (2 Replies)
Discussion started by: thepurple
2 Replies

4. Shell Programming and Scripting

Extract zip code information from address, put into new column

Hi, suppose I have a colon delimeterd file with address field like this blue:john's hospital new haven CT 92881-2322 yellow:La times copr red road los angeles CA90381 1302 red:las vegas hotel sand drive Las vegas NV,21221 How do I create a new field that contain the zip code information... (3 Replies)
Discussion started by: grossgermany
3 Replies

5. Shell Programming and Scripting

Changing one column of delimited file column to fixed width column

Hi, Iam new to unix. I have one input file . Input file : ID1~Name1~Place1 ID2~Name2~Place2 ID3~Name3~Place3 I need output such that only first column should change to fixed width column of 15 characters of length. Output File: ID1<<12 spaces>>Name1~Place1 ID2<<12... (5 Replies)
Discussion started by: manneni prakash
5 Replies

6. Shell Programming and Scripting

Get a column from one file and put it in another

I have 2 files that I would need from one file the 3rd column and put into the second file. Preferably in KSH . For example file one has file1: Column 1 Column 2 Column 3 Column 4 Column 5 file2: Column 1 Column 2 Column 3 Column 4 Column 5 So take Column 3 and put into file1 making it... (4 Replies)
Discussion started by: bombcan1
4 Replies

7. Shell Programming and Scripting

Put Header on Text file of all column

Hi I have in put file A.txt ABCDE1 JFHFJFJF3 1 1 SC1 12/10 ABCDE2 JFHFJFJF5 1 1 SC1 12/10 ABCDE3 JFHFJFJF5 1 1 SC1 12/10 ABCDE4 JFHFJFJF6 1 1 SC1 12/10 I want output in .csv with header: Name SUb_N x y No Board ABCDE1 JFHFJFJF3 1 1 SC1 12/10 ABCDE2 JFHFJFJF5 1 1 SC1... (7 Replies)
Discussion started by: pareshkp
7 Replies

8. Shell Programming and Scripting

Copy column string and put in different column

Hello Here is my input: SU3902 SU3902A NS29C (10) (00) Q1J1 0 SU3902 SU3902B VLR05 (20) (02) Q2H1 4 SU3902 SU3902C NBR22 (30) (06) Q3R5 8 SU3904 SU39047 NSV19 (11) (09) Q4k6 2 SU3904 SU39048 LB231 (12) (05) Q5k1 6 SU3904 SU39049 11VLT (13) (08) Q10C1 10 SU3904 SU3904A 25R05 (15) (06)... (3 Replies)
Discussion started by: pareshkp
3 Replies

9. Shell Programming and Scripting

Take values from a column and put it in a variable and compare

Hi, I have a table in unix from which i want to read the contents line by line, then filter out the values from 6th column one by one and compare it a fixed value. How to do this? (7 Replies)
Discussion started by: arijitsaha
7 Replies

10. Shell Programming and Scripting

remove brackets and put it in a column and remove repeated entry

Hi all, I want to remove the remove bracket sign ( ) and put in the separate column I also want to remove the repeated entry like in first row in below input (PA156) is repeated ESR1 (PA156) leflunomide (PA450192) (PA156) leflunomide (PA450192) CHST3 (PA26503) docetaxel... (2 Replies)
Discussion started by: manigrover
2 Replies
apply(3tcl)						       Tcl Built-In Commands						       apply(3tcl)

__________________________________________________________________________________________________________________________________________________

NAME
apply - Apply an anonymous function SYNOPSIS
apply func ?arg1 arg2 ...? _________________________________________________________________ DESCRIPTION
The command apply applies the function func to the arguments arg1 arg2 ... and returns the result. The function func is a two element list {args body} or a three element list {args body namespace} (as if the list command had been used). The first element args specifies the formal arguments to func. The specification of the formal arguments args is shared with the proc com- mand, and is described in detail in the corresponding manual page. The contents of body are executed by the Tcl interpreter after the local variables corresponding to the formal arguments are given the val- ues of the actual parameters arg1 arg2 .... When body is being executed, variable names normally refer to local variables, which are cre- ated automatically when referenced and deleted when apply returns. One local variable is automatically created for each of the function's arguments. Global variables can only be accessed by invoking the global command or the upvar command. Namespace variables can only be accessed by invoking the variable command or the upvar command. The invocation of apply adds a call frame to Tcl's evaluation stack (the stack of frames accessed via uplevel). The execution of body pro- ceeds in this call frame, in the namespace given by namespace or in the global namespace if none was specified. If given, namespace is interpreted relative to the global namespace even if its name does not start with "::". The semantics of apply can also be described by: proc apply {fun args} { set len [llength $fun] if {($len < 2) || ($len > 3)} { error "can't interpret "$fun" as anonymous function" } lassign $fun argList body ns set name ::$ns::[getGloballyUniqueName] set body0 { rename [lindex [info level 0] 0] {} } proc $name $argList ${body0}$body set code [catch {uplevel 1 $name $args} res opt] return -options $opt $res } EXAMPLES
This shows how to make a simple general command that applies a transformation to each element of a list. proc map {lambda list} { set result {} foreach item $list { lappend result [apply $lambda $item] } return $result } map {x {return [string length $x]:$x}} {a bb ccc dddd} -> 1:a 2:bb 3:ccc 4:dddd map {x {expr {$x**2 + 3*$x - 2}}} {-4 -3 -2 -1 0 1 2 3 4} -> 2 -2 -4 -4 -2 2 8 16 26 The apply command is also useful for defining callbacks for use in the trace command: set vbl "123abc" trace add variable vbl write {apply {{v1 v2 op} { upvar 1 $v1 v puts "updated variable to "$v"" }}} set vbl 123 set vbl abc SEE ALSO
proc(3tcl), uplevel(3tcl) KEYWORDS
argument, procedure, anonymous function Tcl apply(3tcl)
All times are GMT -4. The time now is 08:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy