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
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
:)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
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
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
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
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
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
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
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
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
LEARN ABOUT ULTRIX
binmail
binmail(1) General Commands Manual binmail(1)
Name
binmail - send or receive mail among users
Syntax
/bin/mail [+] [-i] [person...]
/bin/mail [+] [-i] -f file
Description
This is the old version 7 UNIX system mail program. The default command is described in and its binary is in the directory The program is
still used to actually deliver a mail message into the users system-wide mailbox ( ), however, the reading of these messages has been
replaced with the program Do not remove from your system.
The command with no argument prints a user's mail, message-by-message, in last-in, first-out order; the optional argument + displays the
mail messages in first-in, first-out order. For each message, it reads a line from the standard input to direct the disposition of the
message.
Issue the following commands from the program prompt:
<CR> Go on to next message
d Delete message and go on to the next.
p Print message again.
- Go back to previous message.
s [file...] Save the message in the named files (`mbox' default).
w [file...] Save the message, without a header, in the named files (`mbox' default).
m [person...] Mail the message to the named persons (yourself is default).
EOT (control-D) Put unexamined mail back in the mailbox and stop.
q Same as EOT.
!command Escape to the Shell to do command.
* Print a command summary.
An interrupt normally terminates the command; the mail file is unchanged.
When persons are named, takes the standard input up to an end-of-file (or a line with just `.') and adds it to each person's mail file.
The message is preceded by the sender's name and a postmark. Lines that look like postmarks are prepended with `>'. A person is usually a
user name recognized by To denote a recipient on a remote system, prefix person by the system name and exclamation mark. For further
information, see
The program sends a message to the screen that there is mail when the user logs in.
When is used to deliver mail, (usually calls to do this), a mailbox is created for the user in the directory if it doesn't already exist.
The mailbox is created with the mode 700 so that only its owner can access it. In addition, the directory has the mode 777 with the sticky
bit set. The mode is 777 so that other mail programs, notably can create the appropriate lock files to prevent another process from writ-
ing to the mailbox at the same time. The sticky bit set on the directory prevents one user from unlinking another user's mailbox.
Options
-f Displays mail messages contained in the specified file (next argument) in place of your mailbox file.
-i Notifies mail to continue after interrupts.
Restrictions
Race conditions sometimes result in a failure to remove a lock file.
Files
/etc/passwd to identify sender and locate persons
/usr/spool/mail/* incoming mail for user *
mbox saved mail
/tmp/ma* temp file
/usr/spool/mail/*.lock lock for mail directory
dead.letter unmailable text
See Also
mail(1), uucp(1c), uux(1c), write(1), sendmail(8)
binmail(1)