Concatenate lines in file shell script

Tags
advanced

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 01-14-2012
Concatenate lines in file shell script

Hi colleagues,
I have a file in this format.
Code:
"/cccc/pppp/dddd/ggg/prueba.txt".
ERROR"  THE error bbbbbbbbbb finish rows.
"/kkkk/mmmm/hhhh/jjj/ejemplo.txt".
ERROR This is other error rows.

I need my file in this format.
Code:
"/cccc/pppp/dddd/ggg/prueba.txt". ERROR"  THE error bbbbbbbbbb finish rows.
"/kkkk/mmmm/hhhh/jjj/ejemplo.txt". ERROR This is other error rows.

Somebody can say me how to do this jobs?
Thank you for you help.

Last edited by methyl; 01-14-2012 at 01:27 PM.. Reason: please use code tags
# 2  
Old 01-14-2012
Hi,
already tried to google for it?
linux - Concatenate Lines in Bash - Stack Overflow

see ya
fra
# 3  
Old 01-14-2012
@systemoper
Please mention what Operating System and version you have and what Shell you prefer.
Is your example data representative?
# 4  
Old 01-14-2012
Code:
while read line
do
   read line2
  echo "$line" "$line2" 
done <inputfile

This User Gave Thanks to jgt For This Post:
methyl (01-14-2012)
Login to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Similar Threads More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell script to pass the config file lines as variable on the respective called function on a script sadique.manzar Shell Programming and Scripting 6 11-16-2017 07:32 AM
What is the function of the following lines at the top of a shell script file: Directory and Script? remytom Shell Programming and Scripting 4 05-04-2016 08:49 AM
Shell script to read lines in a text file and filter user data Shell Programming and Scripting VikrantD UNIX for Dummies Questions & Answers 3 03-25-2014 04:28 AM
[Solved] Script to concatenate 2 files with the same number of lines gacanepa Shell Programming and Scripting 0 07-25-2013 07:20 PM
Concatenate output in shell script systemoper UNIX for Advanced & Expert Users 8 04-11-2012 05:11 AM
Need to create concatenate the shell variable with file content mac4rfree Shell Programming and Scripting 1 11-28-2011 10:24 AM
Concatenate two lines in a fIle uday.sena.m Programming 3 09-22-2011 12:50 AM
Concatenate lines between lines starting with a specific pattern s052866 Shell Programming and Scripting 9 10-24-2010 01:09 PM
Need Shell Script to delete lines in a file phani333 Shell Programming and Scripting 4 04-29-2010 07:41 PM
concatenate lines using shell scripting dtdt Shell Programming and Scripting 13 09-07-2009 01:14 AM
concatenate log file lines up to timestamp AlanC Shell Programming and Scripting 4 06-29-2009 12:38 PM
Shell script: returning the file with the most lines Breakology Shell Programming and Scripting 11 05-17-2009 12:54 PM
Adding lines to file through a shell script Doctor Manhatta Shell Programming and Scripting 4 02-26-2009 01:47 AM
Help with a shell script to concatenate lists together rfourn Shell Programming and Scripting 1 07-05-2007 11:14 PM
How to cut, concatenate data in Shell Script vasan_srini Shell Programming and Scripting 2 12-07-2005 04:41 AM
All times are GMT -4. The time now is 01:53 PM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?