Sponsored Content
Top Forums Shell Programming and Scripting Help me! Format output file using shell program Post 302469698 by dsubha on Sunday 7th of November 2010 09:31:19 PM
Old 11-07-2010
Help me! Format output file using shell program

Hi,
I have following input file. I want to generate output file in specific format using shell program. The input file has atleast few thousands of lines, the below are some sample lines.

Input file:
Code:
"ORDER NO"|"ORDER AMT"|"LINE ITEM"|"LINE AMT"|"SALES COMMISION %"
ORD3456|5000|LIN345|30|25%
ORD3456|5000
|LIN223|20|15%
0RD3456|5000|LIN221|
10|10
%
ORD3456|
5000|20%
LIN222|5
ORD3456|5000|LIN224|25|30%|ORD2233|6000|LIN0011|24
|100%

Output File:
Code:
"ORDER NO"|"ORDER AMT"|"LINE ITEM"|"LINE AMT"|"SALES COMMISION %"
ORD3456|5000|LIN345|30|25%
ORD3456|5000|LIN223|20|15%
0RD3456|5000|LIN221|10|10%
ORD3456|5000|LIN222|5|20%
ORD3456|5000|LIN224|25|30%
ORD2233|6000|LIN0011|24|100%

Thanks,
Subha

Last edited by Scott; 11-08-2010 at 03:24 AM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how do collect shell output in a C program

i use the system command to execute a shell command... ca i collect the out put in the form of a string or something using the same C program? (5 Replies)
Discussion started by: damn_bkb
5 Replies

2. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies

3. Shell Programming and Scripting

shell script to format command output

Hello team, I am running below command which is giving following output. bash-3.00$ ps -eo pid,pcpu,args | sort +1n | grep -i java 12 0.0 grep -i java 8804 0.0 /opt/app/ccr/home/ccr/WebSphere/AppServer/java/bin/sparcv9/java -XX:+UnlockDiag 9241 0.0... (7 Replies)
Discussion started by: coolguyamy
7 Replies

4. Shell Programming and Scripting

Format options while Redirecting output of sql to a file in shell

In my korn shell - I have a sql with say 6 columns whose output i am redirecting to a file and attaching this file while sending a mail. While all this happens correctly, i face issues in the format of this file. my intended output is Column_1 Column_2 Column_3 Column_4 ... (7 Replies)
Discussion started by: qwertyu
7 Replies

5. Shell Programming and Scripting

Passing multiple C program output into a shell

Hi I have the following C code # cat test.c #include <stdio.h> main() { printf ("The output is : Power\n"); printf ("The output is : No Power\n"); } The output of this C code is # ./test The output is : Power The output is : No Power Now i need to pass this outputs into a shell... (4 Replies)
Discussion started by: Priya Amaresh
4 Replies

6. Shell Programming and Scripting

UNIX shell script to format output report

i am new to unix shell scripting, could someone please help me. i was asked to develop a unix script and requirement of the script is as follows: 1. In source directory, if any new files are being dropped by external system then an email should be sent out with a message saying "files are... (3 Replies)
Discussion started by: crefi1545
3 Replies

7. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

8. Shell Programming and Scripting

Shell output format like table

Hi, OS: Redhat 7.5 shell: Bash Wrote below script to login into oracle via shell script and trying to reset locked account..It works as expected. But I need specific output << EOF should go to target terminal not all out put running below script from ansible command line.. #!/bin/bash... (1 Reply)
Discussion started by: onenessboy
1 Replies

9. Programming

Python or Shell script to Grep strings from input file and output in csv format

Hi Experts, I am writing a python script to grep string from file and display output in csv file as in attached screenshot https://drive.google.com/file/d/1gfUUdfmQma33tz65NskThYDhkZUGQO0H/view Input file(result_EPFT_config_device) Below is the python script i have prepared as of... (1 Reply)
Discussion started by: as7951
1 Replies

10. UNIX for Beginners Questions & Answers

How to convert any shell command output to JSON format?

Hi All, I am new to shell scripting, Need your help in creating a shell script which converts any unix command output to JSON format output. example: sample df -h command ouput : Filesystem size used avail capacity Mounted /dev/dsk/c1t0d0s0 8.1G 4.0G 4.0G 50% /... (13 Replies)
Discussion started by: balu1234
13 Replies
XScreenSaver(1) 					      General Commands Manual						   XScreenSaver(1)

NAME
crystal - kaleidescope. SYNOPSIS
crystal [-display host:display.screen] [-visual visual] [-window] [-root] [-grid] [-no-cell] [-centre] [-nx number] [-ny number] [-count number] [-delay number] [-ncolors number] DESCRIPTION
Moving polygons, similar to a kaleidescope (more like a kaleidescope than the hack called `kaleid,' actually.) OPTIONS
-visual visual Specify which visual to use. Legal values are the name of a visual class, or the id number (decimal or hex) of a specific visual. -window Draw on a newly-created window. This is the default. -root Draw on the root window. -grid | -no-grid Whether to draw grid. -cell | -no-cell Whether to draw the cell. -centre | -no-centre Whether to center on screen -nx number Horizontal Symmetries. -10 - 10. Default: -3. -ny number Vertical Symmetries. -10 - 10. Default: -2. -count number Count. -5000 - 5000. Default: -500. -delay number Per-frame delay, in microseconds. Default: 60000 (0.06 seconds.). -ncolors number Number of Colors. Default: 100. ENVIRONMENT
DISPLAY to get the default host and display number. XENVIRONMENT to get the name of a resource file that overrides the global resources stored in the RESOURCE_MANAGER property. SEE ALSO
X(1), xscreensaver(1) COPYRIGHT
Copyright (C) 2002 by Jouk Jansen. Permission to use, copy, modify, distribute, and sell this software and its documentation for any pur- pose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. No representations are made about the suitability of this software for any pur- pose. It is provided "as is" without express or implied warranty. AUTHOR
Jouk Jansen. X Version 11 XScreenSaver(1)
All times are GMT -4. The time now is 03:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy