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:
Output File:
Thanks,
Subha
Last edited by Scott; 11-08-2010 at 03:24 AM..
Reason: Please use code tags
There is a real problem with this part of you example:
There is no way to tell the end of a record, see how % must be joined up to previous line but ORD3456 dosn't. This is because the record seperator was a newline, but extra new lines have been added to your file.
Can we use some sort of knowledge about the data, eg does each order number start with the string "ORD"?
---Edit---
Below is even worse, the fields have swapped order! A program may be able to sort this out, but it must make assumptions about the data from it's format and determine where it belongs.
Can you give some rules that the data must follow?
Last edited by Chubler_XL; 11-07-2010 at 11:33 PM..
Hi,
Please check the input file and output file. I have added rules to consider. Somehow in previous post the posted blank new lines disappeared.
Input file:
Output file:
Rule:
1. If delimiter '|' occurrances is 4 then it should be treated as seperate line
2. For wrapped lines new line exists at start of line and end of line.
3. For concatenated lines if delimiter '|' occurances exceeds 4 then it should be broken to new line starting from 5 occurance.
Last edited by Scott; 11-08-2010 at 03:25 AM..
Reason: Code tags
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)
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)
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)
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)
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)
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)
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)
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)
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)