LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-02-2014, 08:51 AM   #1
suneelbabu.etl
LQ Newbie
 
Registered: Mar 2014
Posts: 6

Rep: Reputation: Disabled
Thumbs up remove new lines


hi
Code:
10,"Special Projects,bangaram",0,,0
10,"Statutory/ Internal Audit , MO reporting (incl Excel Spreadsheet uploadation)",	bangaram,0,,0
10,"Complience with SVCCL",	bangaram,	0,,	0
10,	"Release of incentives / commission to all channel partners.
",	bangaram,	0,,	0
10,"Timely processing of sales orders to channel partners",	bangaram,	0,,	0
10,"	Balance sheet Reviwe", bangaram,	0,,	0
10,"	Ensuring Critical Reconciliation on monthly basis. (IN-GL)",	bangaram,	0,,	0
10,	"Timely & accurate closure of Accounts.
",	bangaram,	0,,	0
11,"	Opex Spend on communication activites",	bangaram,	0,,	0
11,"	Opex Spend on communication activites",	bangaram	,0,,	0
i want to output like
Code:
10,"Special Projects,bangaram",0,,0
10,"Statutory/ Internal Audit , MO reporting (incl Excel Spreadsheet uploadation)",     bangaram,0,,0
10,"Complience with SVCCL",     bangaram,       0,,     0
10,     "Release of incentives / commission to all channel partners.",      bangaram,       0,,     0
10,"Timely processing of sales orders to channel partners",     bangaram,       0,,     0
10,"    Balance sheet Reviwe", bangaram,        0,,     0
10,"    Ensuring Critical Reconciliation on monthly basis. (IN-GL)",    bangaram,       0,,     0
10,     "Timely & accurate closure of Accounts.",      bangaram,       0,,     0
11,"    Opex Spend on communication activites", bangaram,       0,,     0
11,"    Opex Spend on communication activites", bangaram        ,0,,    0

here logic is every row should be 5 comma's if not just concatenate to next line..(it deletes the new lines) that's it.. plz tel me how to write shell script...

Last edited by unSpawn; 03-08-2014 at 06:54 AM. Reason: //vBB code tags
 
Old 03-02-2014, 01:48 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
What ?
Please explain

and SPELL OUT YOUR WORDS !!!!
"please" IS NOT SPELLED AS "plz" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
this is NOT a telephone and you are NOT !!!!! TEXTING!!!!!!!!!!!!!!
so please REFRAIN from using "text-speak"


as to a shell script
we will NOT do it for you

so please POST what you have done so far and where you are stuck
 
Old 03-03-2014, 01:45 AM   #3
suneelbabu.etl
LQ Newbie
 
Registered: Mar 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
in my file have 5 columns..
in that middle of that data have new lines ..
just delete new lines and add to previous line..

That's it
 
1 members found this post helpful.
Old 03-03-2014, 02:35 AM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
please post what you have so far for the script
 
Old 03-04-2014, 09:36 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,689

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by suneelbabu.etl View Post
in my file have 5 columns..
in that middle of that data have new lines ..
just delete new lines and add to previous line..

That's it
Ok..so what you're really after is to take any line that starts with a double-quote ("), and join it to the end of the line above it. You've shown no effort of your own, because that question has been asked (and answered), THOUSANDS of times on Google already, and if you tried to look it up, you'd have found it. An example:
Code:
sed '/^X/{N;s/\n/ /;}'
 
  


Reply

Tags
linux, sheel, unix



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Remove all lines containing 'A,,,,,,' hattori.hanzo Programming 6 11-03-2010 11:09 PM
[SOLVED] how to remove X lines from output hurryi Linux - Newbie 5 10-11-2010 05:40 AM
How to remove lines and parts of lines from python strings? golmschenk Programming 3 11-26-2009 11:29 PM
How to remove the first part of lines? daYz Linux - Software 3 11-26-2005 06:09 PM
how to remove all commented lines win32sux Linux - General 11 05-08-2004 03:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration