Sponsored Content
Top Forums Shell Programming and Scripting Linux - Script to generate the output delimited by Comma/Pipe Post 302592100 by dsfreddie on Sunday 22nd of January 2012 09:26:03 PM
Old 01-22-2012
Linux - Script to generate the output delimited by Comma/Pipe

Hi All,

I have a requirement where I need to go to a directory, list all the files that start with person* (for eg) & read the most recent file from the list of files.

While browsing through the forum, i found that the command ls -t will list the files. I am trying to generate the output of this command in pipedelimited/comma separated format.

ie like person.20120104|person.20120103|person.20120102

Can you pls help me with the Linux command for the same.

Thanks,
Freddie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Comma Delimited Output w/ egrep

Hi all, I have an input file that I am pulling out certain phases using the following commands: cat /nodes.txt | egrep -e 'OSVersion|PrimaryNodeName' Currently the output looks like this: OSVersion - 5.0 PrimaryNodeName - serverA OSVersion - 5.0 PrimaryNodeName - serverB OSVersion... (2 Replies)
Discussion started by: indianadoug
2 Replies

2. Shell Programming and Scripting

How to generate a pipe ( | ) delimited file?

:)Hi Friends, I have certain log files extracted. I want it to be converted in pipe ( | ) delimited file. How do i do it? E.g. Account Balance : 123456789 Rs O/P (Account Balance: | 123456789 Rs) Account Balance (Last) > 987654321 Rs O/P (Account Balance (Last) | 987654321 Rs) Last... (5 Replies)
Discussion started by: anushree.a
5 Replies

3. Shell Programming and Scripting

Converting comma separated to pipe delimited file

Hi, I came across a very good script to convert a comma seperated to pipe delimited file in this forum. the script serves most of the requirement but looks like it does not handle embedded double quotes and commas i.e if the input is like 1234, "value","first,second", "LDC5"monitor",... (15 Replies)
Discussion started by: anijan
15 Replies

4. Shell Programming and Scripting

Remote command output to file comma delimited

All, I am trying to run a command that will get the serial number, model, and hostname of a server and then output the 3 fields comma delimited. Then a new line to separate the 3 fields for each host. So, I run a for loop that reads in the list of hosts in a file and then runs these sudo... (0 Replies)
Discussion started by: markdjones82
0 Replies

5. Shell Programming and Scripting

Pipe delimited output

Hi All, i have the following command df|awk '{print $5}'|grep /| egrep -v '^/$|/usr|/opt|/var/log|/home|/tmp' output looks like: /filesystem/number1 /filesystem/number2 /filesystem3 /possiblymoreoutput i want the output to look like the below (either in a file or to output to... (3 Replies)
Discussion started by: Tommyk
3 Replies

6. Shell Programming and Scripting

Need a script to convert comma delimited files to semi colon delimited

Hi All, I need a unix script to convert .csv files to .skv files (changing a comma delimited file to a semi colon delimited file). I am a unix newbie and so don't know where to start. The script will be scheduled using cron and needs to convert each .csv file in a particular folder to a .skv... (4 Replies)
Discussion started by: CarpKing
4 Replies

7. Shell Programming and Scripting

Grep:pipe delimited output

Hi, I am trying to search for a string in a file and print all the matched lines as pipe delimited format. My command is cat m_gid_trans.XML|grep -i '<TABLEATTRIBUTE NAME ="Lookup cache directory name"' The output I am getting is <TABLEATTRIBUTE NAME ="Lookup cache directory name"... (4 Replies)
Discussion started by: sampoorna
4 Replies

8. Shell Programming and Scripting

How to cut a pipe delimited file and paste it with another file to form a comma separated outputfile

Hello ppl I have a requirement to split (cut in unix) a file (A.txt) which is a pipe delimited file into A1.txt and A2.txt Now I have to join (paste in unix) this A2.txt with external file A3.txt to form output file A4.txt which should be CSV (comma separated file) so that third party can... (25 Replies)
Discussion started by: etldev
25 Replies

9. Shell Programming and Scripting

Linux convert Comma delimited file to pipe

I have file in linux with comma delimited and string fields in double quotations ", I need to convert them to pipe delimiter please share your inputs. Example: Input: "2017-09-30","ACBD,TVF","01234",NULL,18,NULL,"686091802","BANK OF ABCD, LIMITED, THE",790456 Output: ... (4 Replies)
Discussion started by: shieksir
4 Replies

10. Shell Programming and Scripting

Get the output of w command in pipe delimited format

Since output of w command have variable number of columns I want to get the output in pipe delimited format. I tried export OFS="|"; w but that does not work. Any ideas? (4 Replies)
Discussion started by: Soham
4 Replies
Tangram::Expr(3pm)					User Contributed Perl Documentation					Tangram::Expr(3pm)

NAME
Tangram::Expr - represent expressions on database server side SYNOPSIS
my ($r1, $r2) = $storage->remote(qw( ... )); $r1->{field} operator $value $r1->{field} operator $r2->{field2} $r1->{collection}->includes( $obj ) $r1->{collection}->exists( $obj, $filter ) $r1->{collection}->includes_or( $obj1, $obj2, ... ) DESCRIPTION
Tangram::Expr objects represent expressions that will be evaluated on the database server side. Expression objects fall into one of the following categories: numeric, string, reference or collection. Many of the methods in Expr are needed only by people extending Tangram. See also Tangram::Relational, and the source the Tangram::mysql and Tangram::Sybase for examples on how these functions are intercepted to allow RDBMS-specific expressions. NUMERIC EXPRESSIONS
Numeric expression objects can be compared using the operators ==, !=, <, >, <= and >=. The other operand must be either another numeric expression object, or a normal Perl numeric value. The result of the comparison is a Filter. STRING EXPRESSIONS
String expression objects can be compared using the operators eq, ne, lt, gt, le, and ge. The other operand must be either a string expression object or any Perl scalar value. Tangram will automatically quote the operand as required by the SQL syntax. The result of the comparison is a Tangram::Expr::Filter. String expression objects also support the method like($str), where $str is a string that may contain SQL wildcards. The result is a Tan- gram::Expr::Filter that translates to a SQL "LIKE $str" predicate. REFERENCE EXPRESSIONS
Reference expression objects can be compared for equality using operators == and !=. The other operand must be another reference expres- sion, a persistent object or undef(). The result of the comparison is a Filter. COLLECTION EXPRESSIONS
Collection expression objects represents a collection inside an object. It supports the includes() and exists() methods, which returns a Tangram::Expr::Filter stating that the collection must contain the operand. exists() uses a subselect. It also supports the includes_or() methods, which accepts a list and is performs a logical OR - using the IN (x,y,z) SQL construct. The operand may be a Tangram::Remote, a persistent object, or an object ID. operator < is provided as a synonym for includes(). The includes() method can be used for all collection types (Set, Array, Hash, and the Intr* versions). PREDICATES
Predicate objects represent logical expressions, or conditions. Predicates support logical operators &, | and !. Note that a single amper- sand or vertical bar must be used (this is a Perl limitation). The result is another predicate. CLASS METHODS
new($type, $expr, @remotes) Returns a new instance. $type is a Type object corresponding to this expression (see Tangram::Type). $expr is a SQL expression. It will eventually become part of a WHERE-CLAUSE. @remotes contains the Remote objects (see Tangram::Remote) that participate in the expression. Tangram uses this list to insert the corre- sponding tables in the FROM clause and conditions in the WHERE-CLAUSE. INSTANCE METHODS
expr() Returns the SQL equivalent for this expression. type() Returns the Type (see Tangram::Type) corresponding to this expression. objects() Returns the list of the objects that participate in this expression. storage() Returns the Storage associated with this expression. EXAMPLES
$person is called 'Homer' $person->{name} eq 'Homer' $person's name ends with 'mer' $person->{name}->like('%mer'); $person is older than 35 $person->{age} > 35 $person is married to $homer $person->{partner} == $homer $person is not $homer $person != $homer $person is not $homer and is older than 65 $person != $homer & $person->{age} > 65 $person is $bart's parent $person->{children}->includes( $bart ) $person->{children} < $bart $person is not $bart's parent !$person->{children}->includes( $bart ) !($person->{children} < $bart) $person is one of the local list of people, @person $person->in(@person) SEE ALSO
Tangram::Remote, Tangram::Expr, Tangram::Storage perl v5.8.8 2006-03-29 Tangram::Expr(3pm)
All times are GMT -4. The time now is 09:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy