Sponsored Content
Full Discussion: Combining multiple lines
Top Forums Shell Programming and Scripting Combining multiple lines Post 78075 by DUST on Friday 15th of July 2005 08:49:22 AM
Old 07-15-2005
Combining multiple lines

I am fairly new to scripting. But I have been able to extract and format all of my information required into one file. My issue is that one character is on a separate line. I need to be able to add the character to the previous line.

ex.

abcdefghi
1
bcdefghij
3
cdefghijk
4

need to look like

abcdefghi1
bcdefghij3
cdefghijk4


Any help would be appreciated

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need help appending lines/combining lines within a file...

Is there a way to combine two lines onto a single line...append the following line onto the previous line? I have the following file that contains some blank lines and some lines I would like to append to the previous line... current file: checking dsk c19t2d6 checking dsk c19t2d7 ... (2 Replies)
Discussion started by: mr_manny
2 Replies

2. Shell Programming and Scripting

Sed: Combining Multiple Lines into one

Before I ask my actual question, is it going to be a problem that I want to run this process on a 15 Gig file that is ~140 million rows? What I'm trying to do: I have a file that looks like Color,Type,Count,Day Yellow,Full 5 Tuesday Green,Half 6 Wednesday Purple,Half 8 Tuesday ...... (3 Replies)
Discussion started by: goldfish
3 Replies

3. Shell Programming and Scripting

searching thru or combining multiple lines in a unix file

This is the problem actually: This regex: egrep "low debug.*\".*\"" $dbDir/alarmNotification.log is looking for data between the two quotation marks: ".*\" When I hate data like this: low debug 2009/3/9 8:30:20.47 ICSNotificationAlarm Prodics01ics0003 IC... (0 Replies)
Discussion started by: ndedhia1
0 Replies

4. Shell Programming and Scripting

Combining two text lines into one

Here is the sample file: 646 STARTED Tue Dec 30 06:38:53 2008 Job DdCustXAddr_brad has been reset. 647 STARTED Tue Dec 30 06:38:54 2008 Starting Job DdCustXAddr_brad. (...) 704 STARTED Tue Dec 30 06:49:02 2008 Job DdCustXAddr_brad aborted. I want to combine every non-numbered line... (4 Replies)
Discussion started by: mfavero
4 Replies

5. Shell Programming and Scripting

Combining lines between two specific lines

Hi, I have a requirement like following: I have input file like: Question: 1 ----Multiple choice--- What is your favourite colour? Options: a) red b) blue c) none of these Question: 2 ---Multiple choice----- In which month did you join your first job? Options: a) Jan b) Feb c)... (11 Replies)
Discussion started by: ppatra
11 Replies

6. 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

7. Shell Programming and Scripting

Reading two lines in a while loop and combining the lines

Dear all, I have a file like this: imput scaffold_0 1 scaffold_0 10000 scaffold_0 20000 scaffold_0 25000 scaffold_1 1 scaffold_1 10000 scaffold_1 20000 scaffold_1 23283 and I want the output like this: scaffold_0 1 scaffold_0 10000 scaffold_0 10000 scaffold_0 20000... (6 Replies)
Discussion started by: valente
6 Replies

8. UNIX for Dummies Questions & Answers

Need help combining txt files w/ multiple lines into csv single cell - also need data merge

:confused:Hello -- i just joined the forums. I am a complete noob -- only about 1 week into learning how to program anything... and starting with linux. I am working in Linux terminal. I have a folder with a bunch of txt files. Each file has several lines of html code. I want to combine... (2 Replies)
Discussion started by: jetsetter
2 Replies

9. Shell Programming and Scripting

Combining multiple block of lines in one comma separated line

Hi Everyone, On my Linux box I have a text file having block of few lines and this block lines separated by one blank line. I would like to format and print these lines in such a way that this entire block of lines will come as single comma separated line & again next block of lines in next... (7 Replies)
Discussion started by: gr8_usk
7 Replies

10. Shell Programming and Scripting

Combining two lines into one, UNIX

Hi All, I have a file which has the following sample lines -- <Member name="Canada" Currency="CAD" -- <Member name="UK" Currency="GBP" -- <Member name="Switzerland" Currency="CHF" -- <Member name="Germany" Currency="EUR" -- (11 Replies)
Discussion started by: dev.devil.1983
11 Replies
XrmPutLineResource()													      XrmPutLineResource()

Name
  XrmPutLineResource - add a resource specification to a resource database.

Synopsis
  void XrmPutLineResource(database, line)
	  XrmDatabase *database;
	  char *line;

Arguments
  database  Specifies  a pointer to the resource database.  If database contains NULL, a new resource database is created and a pointer to it
	    is returned in database.  If a database is created, it is created in the current locale.

  line	    Specifies the resource name (possibly with multiple components) and value pair as a single string, in the format resource:value.

Description
  XrmPutLineResource() adds a single resource entry to the specified database.	The line string is parsed in the locale of the database.   If
  the  resource  name is not in the Host Portable Character Encoding the result is implementation-dependent.  Note that comment lines are not
  stored.

  XrmPutLineResource() is similar to XrmPutStringResource(), except that instead of having separate string arguments for the resource and its
  value,  XrmPutLineResource() takes a single string argument (line) which consists of the resource name, a colon, then the value.  Since the
  value is a string, it is stored into the database with representation type String.

  Any whitespace before or after the name or colon in the line argument is ignored.  The value is terminated by a new-line or a NULL  charac-
  ter.	The value may contain embedded new-line characters represented by the "" and "n" two-character pair (not the single "
" character),
  which are converted into a single linefeed character.  In addition, the value may run over onto the next line; this is indicated by  a  ""
  character at the end of each line to be continued.

  Null-terminated  strings  without  a	new  line  are also permitted.	XrmPutResource(), XrmQPutResource(), XrmPutStringResource(), XrmQPut-
  StringResource() and XrmPutLineResource() all store data into a database.  See XrmQPutResource() for the most complete description of  this
  process.

  For more information, see Volume One, Chapter 13, Managing User Preferences.

Structures
  XrmDatabase is a pointer to an opaque data type.

See Also
  XrmDestroyDatabase(),  XrmGetFileDatabase(),	XrmGetResource(),  XrmGetStringDatabase(), XrmInitialize(), XrmMergeDatabases(), XrmParseCom-
  mand(), XrmPutFileDatabase(), XrmPutResource(), XrmPutStringResource(),  XrmQGetResource(),  XrmQGetSearchList(),  XrmQGetSearchResource(),
  XrmQPutResource(),  XrmQPutStringResource(), XrmQuarkToString(), XrmStringToBindingQuarkList(), XrmStringToQuarkList(), XrmStringToQuark(),
  XrmUniqueQuark().

Xlib - Resource Manager 												      XrmPutLineResource()
All times are GMT -4. The time now is 11:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy