Concatenate lines in file shell script


Login or Register 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 12:27 PM.. Reason: please use code tags
# 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 or Register to Reply

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

More UNIX and Linux Forum Topics You Might Find Helpful
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 06: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 07: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 03:28 AM
[Solved] Script to concatenate 2 files with the same number of lines gacanepa Shell Programming and Scripting 0 07-25-2013 06:20 PM
Concatenate output in shell script systemoper UNIX for Advanced & Expert Users 8 04-11-2012 04:11 AM
Need to create concatenate the shell variable with file content mac4rfree Shell Programming and Scripting 1 11-28-2011 09:24 AM
Concatenate two lines in a fIle uday.sena.m Programming 3 09-21-2011 11:50 PM
Concatenate lines between lines starting with a specific pattern s052866 Shell Programming and Scripting 9 10-24-2010 12:09 PM
Need Shell Script to delete lines in a file phani333 Shell Programming and Scripting 4 04-29-2010 06:41 PM
concatenate lines using shell scripting dtdt Shell Programming and Scripting 13 09-07-2009 12:14 AM
concatenate log file lines up to timestamp AlanC Shell Programming and Scripting 4 06-29-2009 11:38 AM
Shell script: returning the file with the most lines Breakology Shell Programming and Scripting 11 05-17-2009 11:54 AM
Adding lines to file through a shell script Doctor Manhatta Shell Programming and Scripting 4 02-26-2009 12:47 AM
Help with a shell script to concatenate lists together rfourn Shell Programming and Scripting 1 07-05-2007 10:14 PM
How to cut, concatenate data in Shell Script vasan_srini Shell Programming and Scripting 2 12-07-2005 03:41 AM