Sponsored Content
Full Discussion: Pipe delimited output
Top Forums Shell Programming and Scripting Pipe delimited output Post 302756605 by Scott on Wednesday 16th of January 2013 06:45:02 AM
Old 01-16-2013
You could add paste -sd\| to the end of your command.

You could also combine all of that into a single awk with ORS=\|

For example (my df is slightly different to yours, so the command is different too)

Code:
$ df -hP | awk '$6 ~ /^\/opt$|^\/usr$/ { print $6 }' ORS=\|
/opt|/usr|


Last edited by Scott; 01-16-2013 at 08:01 AM.. Reason: Actually, it's probably the same df, just I've used the -h -P options!
This User Gave Thanks to Scott For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

convert a pipe delimited file to a':" delimited file

i have a file whose data is like this:: osr_pe_assign|-120|wg000d@att.com|4| osr_evt|-21|wg000d@att.com|4| pe_avail|-21|wg000d@att.com|4| osr_svt|-11|wg000d@att.com|4| pe_mop|-13|wg000d@att.com|4| instar_ready|-35|wg000d@att.com|4| nsdnet_ready|-90|wg000d@att.com|4|... (6 Replies)
Discussion started by: priyanka3006
6 Replies

2. UNIX for Dummies Questions & Answers

Delete last value from pipe delimited file

I have a large(ish) pipe delimited file. The last line of the file contains a total row count and a checksum: END|1537451|1328569446 After making other adjustments to the file, I need to strip out the checksum and apply a new value - I have a script to generate the checksum and 'cat' it... (3 Replies)
Discussion started by: relentl3ss
3 Replies

3. Shell Programming and Scripting

How to convert a space delimited file into a pipe delimited file using shellscript?

Hi All, I have space delimited file similar to the one as shown below.. I need to convert it as a pipe delimited, the values inside the pipe delimited file should be as highlighted... AA ATIU2345098809 009697 005374 BB ATIU2345097809 005445 006518 CC ATIU9685098809 003215 003571 DD... (7 Replies)
Discussion started by: nithins007
7 Replies

4. Shell Programming and Scripting

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... (1 Reply)
Discussion started by: dsfreddie
1 Replies

5. Shell Programming and Scripting

Help with converting Pipe delimited file to Tab Delimited

I have a file which was pipe delimited, I need to make it tab delimited. I tried with sed but no use cat file | sed 's/|//t/g' The above command substituted "/t" not tab in the place of pipe. Sample file: abc|123|2012-01-30|2012-04-28|xyz have to convert to: abc 123... (6 Replies)
Discussion started by: karumudi7
6 Replies

6. 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

7. Shell Programming and Scripting

How to ignore Pipe in Pipe delimited file?

Hi guys, I need to know how i can ignore Pipe '|' if Pipe is coming as a column in Pipe delimited file for eg: file 1: xx|yy|"xyz|zzz"|zzz|12... using below awk command awk 'BEGIN {FS=OFS="|" } print $3 i would get xyz But i want as : xyz|zzz to consider as whole column... (13 Replies)
Discussion started by: rohit_shinez
13 Replies

8. Shell Programming and Scripting

Pipe delimited to csv

I have a small quandry. I had server reports that I pulled from a database that came out pipe "|" delimited. The developers have now changed the format to CSV. The issue is that some fields have quotes around the text and other fields are blank with strings of commas denoting each field. To further... (2 Replies)
Discussion started by: dagamier
2 Replies

9. UNIX for Dummies Questions & Answers

Need to convert a pipe delimited text file to tab delimited

Hi, I have a rquirement in unix as below . I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column. ex: Input Text file: 1|A|apple 2|B|bottle excel file to be generated as output as... (9 Replies)
Discussion started by: raja kakitapall
9 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
ICON(1) 						      General Commands Manual							   ICON(1)

NAME
icon - interpret or compile Icon programs SYNOPSIS
icont [ option ... ] file ... [ -x arg ... ] iconc [ option ... ] file ... [ -x arg ... ] DESCRIPTION
icont and iconc each convert an Icon source program into executable form. icont translates quickly and provides interpretive execution. iconc takes longer to compile but produces programs that execute faster. icont and iconc for the most part can be used interchangeably. This manual page describes both icont and iconc. Where there there are differences in usage between icont and iconc, these are noted. File Names: Files whose names end in .icn are assumed to be Icon source files. The .icn suffix may be omitted; if it is not present, it is supplied. The character - can be used to indicate an Icon source file given in standard input. Several source files can be given on the same command line; if so, they are combined to produce a single program. The name of the executable file is the base name of the first input file, formed by deleting the suffix, if present. stdin is used for source programs given in standard input. Processing: As noted in the synopsis above, icont and iconc accept options followed by file names, optionally followed by -x and arguments. If -x is given, the program is executed automatically and any following arguments are passed to it. icont: The processing performed by icont consists of two phases: translation and linking. During translation, each Icon source file is translated into an intermediate language called ucode. Two ucode files are produced for each source file, with base names from the source file and suffixes .u1 and .u2. During linking, the one or more pairs of ucode files are combined to produce a single icode file. The ucode files are deleted after the icode file is created. Processing by icont can be terminated after translation by the -c option. In this case, the ucode files are not deleted. The names of .u1 files from previous translations can be given on the icont command line. These files and the corresponding .u2 files are included in the linking phase after the translation of any source files. The suffix .u can be used in place of .u1; in this case the 1 is supplied auto- matically. Ucode files that are explicitly named are not deleted. iconc: The processing performed by iconc consists of two phases: code generation and compilation and linking. The code generation phase produces C code, consisting of a .c and a .h file, with the base name of the first source file. These files are then compiled and linked to produce an executable binary file. The C files normally are deleted after compilation and linking. Processing by iconc can be terminated after code generation by the -c option. In this case, the C files are not deleted. OPTIONS
The following options are recognized by icont and iconc: -c Stop after producing intermediate files and do not delete them. -e file Redirect standard error output to file. -f s Enable full string invocation. -o name Name the output file name. -s Suppress informative messages. Normally, both informative messages and error messages are sent to standard error output. -t Arrange for &trace to have an initial value of -1 when the program is executed and for iconc enable debugging features. -u Issue warning messages for undeclared identifiers in the program. -v i Set verbosity level of informative messages to i -E Direct the results of preprocessing to standard output and inhibit further processing. The following additional options are recognized by iconc: -f string Enable features as indicated by the letters in string: a all, equivalent to delns d enable debugging features: display(), name(), variable(), error trace back, and the effect of -f n (see below) e enable error conversion l enable large-integer arithmetic n produce code that keeps track of line numbers and file names in the source code s enable full string invocation -n string Disable specific optimizations. These are indicated by the letters in string: a all, equivalent to cest c control flow optimizations other than switch statement optimizations e expand operations in-line when reasonable (keywords are always put in-line) s optimize switch statements associated with operation invocations t type inference -p arg Pass arg on to the C compiler used by iconc -r path Use the run-time system at path, which must end with a slash. -C prg Have iconc use the C compiler given by prg ENVIRONMENT VARIABLES
When an Icon program is executed, several environment variables are examined to determine certain execution parameters. Values in paren- theses are the default values. BLKSIZE (500000) The initial size of the allocated block region, in bytes. COEXPSIZE (2000) The size, in words, of each co-expression block. DBLIST The location of data bases for iconc to search before the standard one. The value of DBLIST should be a blank-separated string of the form p1 p2 ... pn where the pi name directories. ICONCORE If set, a core dump is produced for error termination. ICONX The location of iconx, the executor for icode files, is built into an icode file when it is produced. This location can be overridden by setting the environment variable ICONX. If ICONX is set, its value is used in place of the location built into the icode file. IPATH The location of ucode files specified in link declarations for icont. IPATH is a blank-separated list of directories. The current directory is always searched first, regardless of the value of IPATH. LPATH The location of source files specified in preprocessor $include directives and in link declarations for iconc. LPATH is otherwise sim- ilar to IPATH. MSTKSIZE (10000) The size, in words, of the main interpreter stack for icont. NOERRBUF By default, &errout is buffered. If this variable is set, &errout is not buffered. QLSIZE (5000) The size, in bytes, of the region used for pointers to strings during garbage collection. STRSIZE (500000) The initial size of the string space, in bytes. TRACE The initial value of &trace. If this variable has a value, it overrides the translation-time -t option. FILES
icont Icon translator iconc Icon compiler iconx Icon executor SEE ALSO
The Icon Programming Language, Ralph E. Griswold and Madge T. Griswold, Prentice-Hall Inc., Englewood Cliffs, New Jersey, Second Edition, 1990. Version 9.1 of Icon, Ralph E. Griswold, Clinton L. Jeffery, and Gregg M. Townsend, IPD267, Department of Computer Science, The University of Arizona, 1995. Version 9 of the Icon Compiler, Ralph E. Griswold, IPD237, Department of Computer Science, The University of Arizona, 1995. icon_vt(1) LIMITATIONS AND BUGS
The icode files for the interpreter do not stand alone; the Icon run-time system (iconx) must be present. Stack overflow is checked using a heuristic that is not always effective. 1 November 1995 IPD244b ICON(1)
All times are GMT -4. The time now is 09:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy