help required in converting a file format


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers help required in converting a file format
# 1  
Old 12-30-2014
Oracle help required in converting a file format

My file format:
Code:
--------------------------------------------------
Complete Consistency Check

Valid Area   :  VALID:VALID
Started by   :  esanwad
Started at   :  Thu Dec 11 16:04:46 2014
CNA version  :  R21H04_EC08
Check range  :  AREA  VALID/VALID

**************************************************
No control file with selected checks found,
all checks are therefore performed.
--------------------------------------------------
Check of Neighbour Relation KG1BSC1:RGK202A:RNB201B
-----------------------------------------------------------------
[82] Parameter KHYST is not equal in Neighbour Relation "RNB201B":RGK202A.
[84] Parameter KHYST is greater than parameter LHYST when EVALTYPE=1.

Check of Internal Cell KG1BSC1:RGK202B
-----------------------------------------------------------------
[161] BCCH frequency 76 is adjacent to BCCH frequency 75 in neighbouring Internal Cell KG1RBSC:RGK203A. BSIC is not equal.
[161] BCCH frequency 76 is adjacent to BCCH frequency 77 in neighbouring Internal Cell KG1RBSC:RRL204C. BSIC is not equal.
[158] TCH frequency 81 is equal to TCH frequency in neighbouring Internal Cell KG1RBSC:RGK201B.


My Desired output:

Code:
Check of Neighbour Relation KG1BSC1:RGK202A:RNB201B
-----------------------------------------------------------------
[82] Parameter KHYST is not equal in Neighbour Relation "RNB201B":RGK202A.
[84] Parameter KHYST is greater than parameter LHYST when EVALTYPE=1.

Check of Internal Cell KG1BSC1:RGK202B
-----------------------------------------------------------------
[161] BCCH frequency 76 is adjacent to BCCH frequency 75 in neighbouring Internal Cell KG1RBSC:RGK203A. BSIC is not equal.
[161] BCCH frequency 76 is adjacent to BCCH frequency 77 in neighbouring Internal Cell KG1RBSC:RRL204C. BSIC is not equal.
[158] TCH frequency 81 is equal to TCH frequency in neighbouring Internal Cell KG1RBSC:RGK201B.

Moderator's Comments:
Mod Comment Please use code tags next time for your code and data...

Last edited by vbe; 12-30-2014 at 05:56 AM..
# 2  
Old 12-30-2014
This looks like you want to remove the first few lines so:-

man sed should help you...

Something like:-
Code:
sed 'x,yd' < infile > outfile

Where x and y are the line number range to delete...
# 3  
Old 12-30-2014
Hello Gautam Banerjee,

Welcome to forums, please use code tags as per forum rules for codes/commands/inputs in your posts, you can read
rules for forums in following link too. https://www.unix.com/misc.php?do=cfrules

For your requirement following may help you in same.
i-
Code:
awk 'NR>=14 && NR<=23'  Input_file

This above will help you to print lines from a specific line to a specific line numbers.

ii-
Code:
sed -n '14,23p'  Input_file

Above code also an example for doing the same operation.

NOTE: If you want to know the line numbers(or want to get numbers along with lines of a file) in a file you can use either
cat -n Input_file or awk '{print ++A OFS $0}' Input_file for same.

Thanks,
R. Singh
# 4  
Old 12-30-2014
If you don't know the line numbers or if the start can vary, try
Code:
sed -n '/^Check of/,$p' file

or
Code:
awk '/^Check of/,EOF' file

.

Btw, I wouldn't say that is "converting a file format" as all data lines are kept unmodified when removing the header lines.
# 5  
Old 01-02-2015
Hi All,

Thanks for the valuable feedback!

All the information provided are really helpful.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help in converting the file format

Hi All, I need help in converting the mentioned file format into desired output format using awk. Could anyone help me in this? Below is the input.. Date Account Campaign AdGroup Keyword Conversion Revenue Var1 Var2 Var3 Var4 Var5 10 20 30 ... (8 Replies)
Discussion started by: Ravi S M
8 Replies

2. Shell Programming and Scripting

Need help to format one txt file to required format

Hello Everyone, I have one source file which is genarated by SAP in different format(Which I've never seen). I need to convert that file to required format and I need to read this target file from Datastage to use this in my Jobs. So I do not have any other options except to use Unix script to... (4 Replies)
Discussion started by: Prathyu
4 Replies

3. UNIX for Advanced & Expert Users

Converting the date format in a flat file

Hi All, I am new to this forum, could any one help me out in resolving the below issue. Input of the flat file contains several lines of text for example find below: 5022090,2,4,7154,88,,,,,4/1/2011 0:00,Z,L,2 5022090,3,1,6648,88,,,,,4/1/2011 0:00,Z,,1... (0 Replies)
Discussion started by: av_sagar
0 Replies

4. Shell Programming and Scripting

Help required converting XSD to XML file in PERL

Hi, Please find below the xsd. <?xml version="1.0" encoding="ISO-8859-1" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="fruitorder"> <xs:complexType> <xs:sequence> <xs:element name="orderperson"... (2 Replies)
Discussion started by: vanitham
2 Replies

5. Shell Programming and Scripting

Converting windows format file to unix format using script

Hi, I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix. My requirement here is that i want to do it automatically using a... (5 Replies)
Discussion started by: sarbjit
5 Replies

6. Shell Programming and Scripting

Converting Unicode file to UTF8 format

Hi, I have a file in my desktop which is a unicode format. After this file is transferred to Unix using FTP, we are seeing some special character (like rectangle box type) at the first line. The same file is saved as UTF8 (using textpad tool, selecting encode to UTF-8 option) on my desktopand... (7 Replies)
Discussion started by: vfrg
7 Replies

7. Shell Programming and Scripting

Converting file format

My input file is Pipe delimited with 10 fields, I am trying to create a tab delimited output file with 6 fields from the provided input file. Below is sample data Input file abc||2|PIN|num||||www.123.com|abc@123.com| bcd||2|PIN|num|||||abc@123.com|... (3 Replies)
Discussion started by: pasupuleti81
3 Replies

8. Shell Programming and Scripting

Sybase Interface file and converting in text format.

Does anyone knows how to decode the address in interface file using shell , i have done it using perl but can it be done in shell. master tli tcp /dev/tcp \x00021004ac1414230000000000000000 query tli tcp /dev/tcp \x00021004ac1414230000000000000000 (0 Replies)
Discussion started by: dinjo_jo
0 Replies

9. Shell Programming and Scripting

converting config file to csv format

Hello, For 2 days now i've been searching for a solution to this. I am now beginning to doubt this is even possible. It's even harder when you don't know how to search for it. (which keywords generate enough relevancy etc..) I need to parse a config file to generate a CSV file in return. It... (7 Replies)
Discussion started by: zer0dvide
7 Replies

10. UNIX for Dummies Questions & Answers

Converting the File Creation Date to a new format

I need to capture a file's creation/modification date and time and convert this to a different format, whilst I can easily get the existing format from a ls -l | awk ' { print $......}' or a cut command I do not know how to convert it to a desired format? I should add that at present the ls -l... (1 Reply)
Discussion started by: barney_clough
1 Replies
Login or Register to Ask a Question