combining two/three line in to one


 
Thread Tools Search this Thread
Operating Systems Linux Red Hat combining two/three line in to one
# 1  
Old 04-17-2008
combining two/three line in to one

Hi Radoulov,
I have tried the code for testing as I too required this on numbers of occasion to combining two line having length of 132 characters .I am
using RedHat 9 Linux.
I am using like if ( nr % 2 == o ) or
if ( nr % 3 == 0 ) and fetching the data from the different
places , as your code seemed me handy I gave a try but did not work even
with nawk too. Can you please say why ?? Will help me too a lot .With Regards. Vakharia MaheshSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Log4j combining lines to single line

Hi, Our log4j file contents look like this: 2018-11-20T00:06:58,888 INFO ql.Driver: Executing command(queryId=hive_20181120000656_49af4ad0-1d37-4312-872c-a247ed80c181): CREATE TABLE RESULTS.E7014485_ALL_HMS_CAP1 AS SELECT name,dept from employee Where employee='Jeff'... (4 Replies)
Discussion started by: wahi80
4 Replies

2. UNIX for Beginners Questions & Answers

Combining lines in one line

Hi below is the input file snippet. here i want that all the line which is coming after 1 shoud be in one line. so for exanple if after 1 there is two lines which is starting with 2 should be combine in one line. input file content 1,8091012,BATCH_1430903_01,21,T,2,808738,,,,21121:87:01,... (19 Replies)
Discussion started by: scriptor
19 Replies

3. Shell Programming and Scripting

Combining lines into a single line

i have a file (where the column values are separated by ' and the text can be enclosed in ~) which contains data in form of 4461,2,~Basic: 2 Years/Unlimited Miles Drivetrain: Gas Engine 2 Years/Unlimited Miles Duramax Engine 3 Years/Unlimited... (2 Replies)
Discussion started by: rahulchandak
2 Replies

4. Shell Programming and Scripting

Combining two files line by line

Hello guys, I have a problem with two text files. I want to join them line by line with a bash script if it is possible. I think an example will be much clear; FILE 1 314.01 83.826 52.43 79.544 316.36 45.283 351.15 87.503 FILE 2 140.323 84.918 130 78.256 120 77.603 118 ... (4 Replies)
Discussion started by: johankor
4 Replies

5. Shell Programming and Scripting

Combining files line by line

Hi, I have 2 files say abc and txt, Contents of abc A B C D . . . Contents of xyz 1 2 3 4 (2 Replies)
Discussion started by: ericJDS
2 Replies

6. Shell Programming and Scripting

Combining lines in to one line

Hi Friends, I have a file1.txt 1001 jkilo yrhfm 200056 jhdf rjhwjkrh 3+u8jk5h3 uru ehjk 1002 jkfhk hfjkd 2748395 fdjksfh hefjkh 3hdfk ejkh kjhjke In the above if you see the firt charcter of each line mentioned in red has a pattern . I need to create another file where , the... (6 Replies)
Discussion started by: i150371485
6 Replies

7. Programming

PERL:Combining multiple lines to single line

Hi All I need a small help for the below format in making a small script in Perl or Shell. I have a file in which a single line entries are broken into three line entries. Eg: I have a pen and notebook. All i want is to capture in a single line in a separate file. eg: I have a pen and... (4 Replies)
Discussion started by: Kalaiela
4 Replies

8. Shell Programming and Scripting

Combining 2 lines in a file into 1 line

Hi all, I have a file with lot of lines with repeating pattern. ( TABLE_NAME line followed by Total line). I would like combine these two lines into one line seperated by cama and create a new file. Is there a simple way to do this. Current Format ( just a sample 4 lines ) TABLE_NAME:... (10 Replies)
Discussion started by: MKNENI
10 Replies

9. Shell Programming and Scripting

Line by Line combining 2 files

I am trying to take 2 files and merge them into a single file pulling one line out of each file at a time. Below is an example of what I am trying to do, thanks for any help in advance. Example of File 1: a1 b1 c1 Example of File 2: a2 b2 c2 Expected Outcome: a1 a2 b1 b2 c1 c2 (2 Replies)
Discussion started by: Takau
2 Replies

10. Programming

Combining multiple command line arguments

suppose the user enters: ./Myfile blah1 blah2 blah3 I want to be able to read that in as: blah1blah2blah3 IN ONE VARIABLE Obviously I can print it out in one line excluding the white space, but I'm having trouble combining argv, argv, ....., argv together! This is what I tried, but I... (3 Replies)
Discussion started by: hansel13
3 Replies
Login or Register to Ask a Question
sccs-comb(1)                                                       User Commands                                                      sccs-comb(1)

NAME
sccs-comb, comb - combine SCCS deltas SYNOPSIS
/usr/ccs/bin/comb [-os] [-csid-list] [-psid] s.filename... DESCRIPTION
comb generates a shell script (see sh(1)) that you can use to reconstruct the indicated s.files. This script is written to the standard output. If a directory name is used in place of the s.filename argument, the comb command applies to all s.files in that directory. Unreadable s.files produce an error; processing continues with the next file (if any). The use of `-' as the s.filename argument indicates that the names of files are to be read from the standard input, one s.file per line. If no options are specified, comb preserves only the most recent (leaf) delta in a branch, and the minimal number of ancestors needed to preserve the history. OPTIONS
The following options are supported: -o For each `get -e' generated, access the reconstructed file at the release of the delta to be created. Otherwise, the recon- structed file is accessed at the most recent ancestor. The use of -o may decrease the size of the reconstructed s.file. It may also alter the shape of the delta tree of the original file. -s Generate scripts to gather statistics, rather than combining deltas. When run, the shell scripts report: the file name, size (in blocks) after combining, original size (also in blocks), and the percentage size change, computed by the formula: 100 * ( original - combined ) / original This option can be used to calculate the space that will be saved, before actually doing the combining. -csid-list Include the indicated list of deltas. All other deltas are omitted. sid-list is a comma-separated list of SCCS delta IDs (SIDs). To specify a range of deltas, use a `-' separator instead of a comma, between two SIDs in the list. -pSID The SID of the oldest delta to be preserved. FILES
s.COMB reconstructed SCCS file comb????? temporary file ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWsprot | +-----------------------------+-----------------------------+ SEE ALSO
sccs(1), sccs-admin(1), sccs-cdc(1), sccs-delta(1), sccs-help(1), sccs-prs(1), sccs-prt(1), sccs-rmdel(1), sccs-sccsdiff(1), what(1), sccs- file(4), attributes(5) DIAGNOSTICS
Use the SCCS help command for explanations (see sccs-help(1)). BUGS
comb may rearrange the shape of the tree of deltas. It may not save any space; in fact, it is possible for the reconstructed file to actu- ally be larger than the original. SunOS 5.10 1 Nov 1999 sccs-comb(1)