Sponsored Content
Full Discussion: Joining multiple lines
Top Forums Shell Programming and Scripting Joining multiple lines Post 63248 by beilstwh on Wednesday 23rd of February 2005 04:09:36 PM
Old 02-23-2005
Power Joining multiple lines

I have data of the following form. It starts its first line with a '{' and ends the last line with a '}'. What I need to do is to join every line starting with the '{' and ending with the '} into one line in the output file. If it was just this one block, I could do a 13 joins in vi, however it contains thousands of blocks of data. Any help would be greatly appreciated.

{F,10,A,R,E,0600,0400,"XXXX"|
T,01, 13,V, 0, 45,00,1,01,01,B,L,0,0 |
T,02, 14,V, 15, 45,00,1,01,01,B,L,0,0 |
T,03, 40,V, 59, 15,00,1,02,01,B,L,0,0 |
T,04, 30,V, 102, 15,00,1,01,01,B,L,0,0 |
T,05, 35,V, 128, 15,00,1,01,01,B,L,0,0 |
T,06, 10,V, 163, 50,00,1,01,01,B,L,0,0 |
T,07, 11,V, 203, 45,00,1,02,02,B,L,0,0 |
T,08, 4,V, 400, 175,00,1,01,01,B,L,0,0 |
T,09, 44,V, 420, 0,00,1,01,01,B,L,0,0 |
T,10, 31,V, 460, 15,00,1,02,01,B,L,0,0 |
T,11, 29,V, 485, 15,00,1,02,01,B,L,0,0 |
T,12, 36,V, 510, 15,00,1,02,01,B,L,0,0 |
T,13, 21,V, 550, 130,00,1,02,01,B,L,0,0 |
}
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Joining 2 lines in a file together

Hi guys, I've got a log file which has entries that look like this: ------------------------------------------------------------------------------- 06/08/04 07:57:57 AMQ9002: Channel program started. EXPLANATION: Channel program 'INSCCPQ1.HSMTSPQ1' started. ACTION: None. ... (3 Replies)
Discussion started by: m223464
3 Replies

2. Shell Programming and Scripting

Joining lines from two files - please help

Hello, I have 2 files say File 1 has ABC DEF GHI File 2 has 123 456 789 I need output as ABC 123 DEF 456 GHI 789 I tried awk and sed but not able to get it in the right way. :confused: Please help. Thanks (25 Replies)
Discussion started by: chandra004
25 Replies

3. Shell Programming and Scripting

joining two lines

Hi , I want to join two lines in a file, where the second line contain query string. if it doesn't contain that string i don't want to join e.g. Input file is as following: name fame game none none none name fame game cat eat mice I need output file as name fame game none none... (2 Replies)
Discussion started by: ashrafonics
2 Replies

4. Shell Programming and Scripting

Need help joining lines

Hi All, I need the command to join 2 lines into one. I found lots of threads but none give me the sollution. Probably because unix scripting is one of my best features ;) I got a logfile where line 2 needs to be joined with line 1, lines 4 needs to be joined with line 3 etc If you need... (16 Replies)
Discussion started by: rene21976
16 Replies

5. Shell Programming and Scripting

pattern matching lines using the date, and then joining the lines

Hi Guys, Was trying to attempt the below using awk and sed, have no luck so far, so any help would be appreciated. Current Text File: The first line has got an "\n", and the second line has got spaces/tabs then the word and "\n" TIME SERVER/CLIENT TEXT... (6 Replies)
Discussion started by: eo29
6 Replies

6. UNIX for Dummies Questions & Answers

JOINING MULTIPLE LINES IN A TEXT FILE USING GAWK

sir... am having a data file of customer master., containing some important fields as a set one line after another., what i want is to have one set of these fields(rows) one after another in line.........then the second set... and so on... till the last set completed. I WANT THE DATA... (0 Replies)
Discussion started by: KANNI786
0 Replies

7. Shell Programming and Scripting

Joining contents in multiple lines to a single line

I do have a file with contents splited into multiple lines ADSLHLJASHGLJSKAGHJJGAJSLGAHLSGHSAKBV AJHALHALHGLAGLHGBJVFBJVLFDHADAH GFJAGJAGAJFGAKGAKGFAK AJHFAGAKAGAGKAKAKGKAGFGJDGDJJDGJDJDFAG ... ... .... 100's of lines I would like to rearrange the content of this file so it will be a... (1 Reply)
Discussion started by: Lucky Ali
1 Replies

8. Shell Programming and Scripting

Joining lines in different way

Hi all, I'm excited to the part of unix.com forum, and noob to it. I have an query, where I have an file and it contains data like this use thread when posting do no I was expecting the result as use thread thread when when posting posting do do no use thread when thread when... (6 Replies)
Discussion started by: Jose Nirmal
6 Replies

9. Shell Programming and Scripting

Joining broken lines and removing empty lines

Hi - I have req to join broken lines and remove empty lines but should NOT be in one line. It has to be as is line by line. The challenge here is there is no end of line/start of line char. thanks in advance Source:- 2003-04-34024|04-10-2003|Claims|Claim|01-13-2003|Air Bag:Driver;... (7 Replies)
Discussion started by: Jackceasar123
7 Replies

10. Shell Programming and Scripting

awk joining multiple lines based on field count

Hi Folks, I have a file with fields as follows which has last field in multiple lines. I would like to combine a line which has three fields with single field line for as shown in expected output. Please help. INPUT hname01 windows appnamec1eda_p1, ... (5 Replies)
Discussion started by: shunya
5 Replies
Tcl_DumpActiveMemory(3) 				      Tcl Library Procedures					   Tcl_DumpActiveMemory(3)

__________________________________________________________________________________________________________________________________________________

NAME
Tcl_DumpActiveMemory, Tcl_InitMemory, Tcl_ValidateAllMemory - Validated memory allocation interface. SYNOPSIS
#include <tcl.h> int Tcl_DumpActiveMemory(fileName) void Tcl_InitMemory(interp) void Tcl_ValidateAllMemory(fileName, line) ARGUMENTS
Tcl_Interp *interp (in) Tcl interpreter in which to add commands. CONST char *fileName (in) For Tcl_DumpActiveMemory, name of the file to which memory information will be written. For Tcl_ValidateAllMemory, name of the file from which the call is being made (normally __FILE__). int line (in) Line number at which the call to Tcl_ValidateAllMemory is made (normally __LINE__). _________________________________________________________________ DESCRIPTION
These functions provide access to Tcl memory debugging information. They are only functional when Tcl has been compiled with TCL_MEM_DEBUG defined at compile-time. When TCL_MEM_DEBUG is not defined, these functions are all no-ops. Tcl_DumpActiveMemory will output a list of all currently allocated memory to the specified file. The information output for each allocated block of memory is: starting and ending addresses (excluding guard zone), size, source file where ckalloc was called to allocate the block and line number in that file. It is especially useful to call Tcl_DumpActiveMemory after the Tcl interpreter has been deleted. Tcl_InitMemory adds the Tcl memory command to the interpreter given by interp. Tcl_InitMemory is called by Tcl_Main. Tcl_ValidateAllMemory forces a validation of the guard zones of all currently allocated blocks of memory. Normally validation of a block occurs when its freed, unless full validation is enabled, in which case validation of all blocks occurs when ckalloc and ckfree are called. This function forces the validation to occur at any point. SEE ALSO
TCL_MEM_DEBUG, memory KEYWORDS
memory, debug Tcl 8.1 Tcl_DumpActiveMemory(3)
All times are GMT -4. The time now is 01:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy