Sponsored Content
Top Forums Shell Programming and Scripting Phrase txt file row to column Post 302938889 by pareshkp on Thursday 19th of March 2015 06:55:43 PM
Old 03-19-2015
Phrase txt file row to column

Hi Guys,

I have one Big txt file and i what to phrase specific part as below.

Input :-

Code:
[2015-02-11 16:15:03.872] Event
Event {
  recordLength 160118,
  recordType 411,
  eventId 3102118,
  INTERNAL_PER_RO_ME_TA {
    EVVXX_TIMESTAMP_HOUR 16,
    EVVXX_TIMESTAMP_MINUTE 15,
    EVVXX_TIMESTAMP_SECOND 3,
    EVVXX_TIMESTAMP_MILLISEC 872,
    EVVXX_SID 600102228,
    EVVXX_EVENT_VADU (0),
    EVVXX_GLOBAL_NB_ID 01219442,
    EVVXX_ENBS1APID unavailable,
    EVVXX_MMES1APID unavailable,
    EVVXX_GUMMEI unavailable,
    EVVXX_RAC_EEFAA 555586410,
    EVVXX_TRACE_RECORDING_SESSION_REFERENCE '00 00 00'H,
    EVVXX_TIMESTAMP_START_HOUR 0,
    EVVXX_TIMESTAMP_START_MINUTE 0,
    EVVXX_TIMESTAMP_START_SECOND 0,
    EVVXX_TIMESTAMP_START_MILLISEC 0,
    EVVXX_TA_INTERVAL 1000,
    EVENT_AAA unavailable,
    EVENT_AAA unavailable,
    EVENT_AAA unavailable
  }
}
[2015-02-11 16:15:03.872] Event
Event {
  recordLength 160119,
  recordType 411,
  eventId 3102118,
  INTERNAL_PER_RO_ME_TA {
    EVVXX_TIMESTAMP_HOUR 17,
    EVVXX_TIMESTAMP_MINUTE 15,
    EVVXX_TIMESTAMP_SECOND 4,
    EVVXX_TIMESTAMP_MILLISEC 872,
    EVVXX_SID 600102228,
    EVVXX_EVENT_VADU (0),
    EVVXX_GLOBAL_NB_ID 01219444,
    EVVXX_ENBS1APID unavailable,
    EVVXX_MMES1APID unavailable,
    EVVXX_GUMMEI unavailable,
    EVVXX_RAC_EEFAA 555586410,
    EVVXX_TRACE_RECORDING_SESSION_REFERENCE '00 00 00'H,
    EVVXX_TIMESTAMP_START_HOUR 0,
    EVVXX_TIMESTAMP_START_MINUTE 0,
    EVVXX_TIMESTAMP_START_SECOND 0,
    EVVXX_TIMESTAMP_START_MILLISEC 0,
    EVVXX_TA_INTERVAL 1000,
    EVENT_AAA unavailable,
    EVENT_AAA unavailable,
    EVENT_AAA unavailable
  }
}

Output :-


Code:
EVVXX_TIMESTAMP_HOUR	EVVXX_TIMESTAMP_MINUTE	EVVXX_TIMESTAMP_SECOND	EVVXX_TIMESTAMP_MILLISEC	EVVXX_SID	EVVXX_EVENT_VADU	EVVXX_GLOBAL_NB_ID	EVVXX_ENBS1APID	EVVXX_MMES1APID	EVVXX_GUMMEI	EVVXX_RAC_EEFAA	EVVXX_TRACE_RECORDING_SESSION_REFERENCE	EVVXX_TIMESTAMP_START_HOUR	EVVXX_TIMESTAMP_START_MINUTE	EVVXX_TIMESTAMP_START_SECOND	EVVXX_TIMESTAMP_START_MILLISEC	EVVXX_TA_INTERVAL	EVENT_AAA	EVENT_AAA	EVENT_AAA
16	15	3	872	600102228	0	1219442	unavailable	unavailable	unavailable	555586410	00 00 00'H	0	0	0	0	1000	unavailable	unavailable	unavailable
17	15	4	872	600102228	0	1219444	unavailable	unavailable	unavailable	555586410	00 00 00'H	0	0	0	0	1000	unavailable	unavailable	unavailable

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing the column for a row in a text file and adding another row

Hi, I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value . For Eg . if the input file has a row : abc xyz lmn 89 lm nk o p I would like the script to create something like... (9 Replies)
Discussion started by: aYankeeFan
9 Replies

2. Shell Programming and Scripting

AWK CSV to TXT format, TXT file not in a correct column format

HI guys, I have created a script to read 1 column in a csv file and then place it in text file. However, when i checked out the text file, it is not in a column format... Example: CSV file contains name,age aa,11 bb,22 cc,33 After using awk to get first column TXT file... (1 Reply)
Discussion started by: mdap
1 Replies

3. Shell Programming and Scripting

How to get the first column from the txt file using unix command?

Hi All, I have the file like this (file name is : tem_text) no Id name ccy ------- ---- ------------------- -------- 7777 17 India Overseas Partners 500INR I want to retreive the third colimn of from the above text file if i use the basic awk command cat... (4 Replies)
Discussion started by: psiva_arul
4 Replies

4. Shell Programming and Scripting

Moving data from a specified column/row to another column/row

Hello, I have an input file like the following: 11_3_4 2_1_35 3_15__ _16989 Where '_' is a space. The data is in a table. Is there a way for the program to prompt the user for x1,y1 and x2,y2, where x1,y1 is the desired number (for example x=6 y=4 is a value of 4) and move to a desired spot... (2 Replies)
Discussion started by: jl487
2 Replies

5. AIX

Adding column in a .txt file

Helle, I want to create a .ksh script in order to realize the following : I have a .txt file organized in a bloc of information, each bloc start with 000 as following: 000... 001... 003... 004... 000... 001... 003... 004... . . My aim is to add a new... (6 Replies)
Discussion started by: zainab2006
6 Replies

6. UNIX for Dummies Questions & Answers

Add a new column to txt file containing filename

I would like help adding a new column to a large txt file (~10MB) that contains the filename. I have searched other posts but have not found an adequate solution. I need this extra column so I can concatenate >100 files and perform awk searches on this large file. My current txt file look... (4 Replies)
Discussion started by: kellywilliams
4 Replies

7. Shell Programming and Scripting

Subtracting each row from the first row in a single column file using awk

Hi Friends, I have a single column data like below. 1 2 3 4 5 I need the output like below. 0 1 2 3 4 where each row (including first row) subtracting from first row and the result should print below like the way shown in output file. Thanks Sid (11 Replies)
Discussion started by: ks_reddy
11 Replies

8. UNIX for Dummies Questions & Answers

awk to print first row with forth column and last row with fifth column in each file

file with this content awk 'NR==1 {print $4} && NR==2 {print $5}' file The error is shown with syntax error; what can be done (4 Replies)
Discussion started by: cdfd123
4 Replies

9. Shell Programming and Scripting

How to find a phrase and pull all lines that follow until the phrase occurs again?

I want to burst a report by using the page number value in the report header. Each section starts with *PAGE NO:* 1 Each section might have several pages, but the next section always starts back at 1. So I want to find the "*PAGE NO:* 1" value and pull all lines that follow until "*PAGE NO:* 1"... (4 Replies)
Discussion started by: Scottie1954
4 Replies

10. UNIX for Dummies Questions & Answers

awk help: how to pull phrase and one column from line above?

Hi everyone, Here's my awk statement so far: awk '/TOTAL TYPE:/{print x;print};{x=$0}' file1 >file2 'file1' has too much proprietary data in it to include here, so let's go with the output from code above. It looks like this: 123456 JAMES T KIRK D ... (2 Replies)
Discussion started by: Scottie1954
2 Replies
SoXI(1) 							  Sound eXchange							   SoXI(1)

NAME
SoXI - Sound eXchange Information, display sound file metadata SYNOPSIS
soxi [-V[level]] [-T] [-t|-r|-c|-s|-d|-D|-b|-B|-e|-a] infile1 ... DESCRIPTION
Displays information from the header of a given audio file or files. Supported audio file types are listed and described in soxformat(7). Note however, that soxi is intended for use only with audio files with a self-describing header. By default, as much information as is available is shown. An option may be given to select just a single piece of information (perhaps for use in a script or batch-file). OPTIONS
-V Set verbosity. See sox(1) for details. -T Used with multiple files; changes the behaviour of -s, -d and -D to display the total across all given files. Note that when used with -s with files with different sampling rates, this is of questionable value. -t Show detected file-type. -r Show sample-rate. -c Show number of channels. -s Show number of samples (0 if unavailable). -d Show duration in hours, minutes and seconds (0 if unavailable). Equivalent to number of samples divided by the sample-rate. -D Show duration in seconds (0 if unavailable). -b Show number of bits per sample. -B Show the bitrate averaged over the whole file (0 if unavailable). -e Show the name of the audio encoding. -a Show file comments (annotations) if available. BUGS
Please report any bugs found in this version of SoX to the mailing list (sox-users@lists.sourceforge.net). SEE ALSO
sox(1), soxformat(7), libsox(3) The SoX web site at http://sox.sourceforge.net LICENSE
Copyright 2008-9 by Chris Bagwell and SoX Contributors. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. AUTHORS
Chris Bagwell (cbagwell@users.sourceforge.net). Other authors and contributors are listed in the ChangeLog file that is distributed with the source code. soxi February 19, 2011 SoXI(1)
All times are GMT -4. The time now is 08:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy