|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Dear friends,
In VI, I have these data shown below: Line1 Line2 Line3 Line4 How can I JOIN these line to the first line? When I finished I should have: Line1 Line2 Line3 Line4 is there a text length limit of how long a single line can be in VI? Thank you much! |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
You want to do this in vi right? Get to command mode in vi. Go to the line which should have the next line appended to it and then press shift-j (upper case j or J). This will append the next line at the end of the line that you currently are on. eg. Your example will work as: Code:
Line1[shift-j] Line1 Line2[shift-j] Line1 Line2 Line3 Line2 -> Line3 -> Line4 and so on... Line3 Line4 Line4 |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Is there a limit in the number of lines to be joined or limit of number of character in a single line?
|
|
#4
|
|||
|
|||
|
Is there a short program that someone can help?
Many thanks! |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
I did give you a reply. You haven't said whether that was any help or not. Also, you are violating the rules. In particular rule 4:
(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post where your goal is to get an answer more quickly. |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
Sorry! I did not mean to violate any rule!
Your post was helped! I am trying but each in my file are too long! Thanks! |
| Sponsored Links | |
|
|
#7
|
||||
|
||||
|
You can do the whole file using... Code:
paste -d ' ' -s file1 > file2 |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Joining multi-line output to a single line in a group | gvk25 | Shell Programming and Scripting | 7 | 03-07-2012 05:22 AM |
| Multiple lines in a single column to be merged as a single line for a record | Bhuvaneswari | Shell Programming and Scripting | 1 | 08-11-2011 03:16 AM |
| Joining contents in multiple lines to a single line | Lucky Ali | Shell Programming and Scripting | 1 | 10-13-2010 09:51 PM |
| joining 2 lines into single one | ali560045 | Shell Programming and Scripting | 3 | 10-16-2008 08:56 AM |
| Joining lines in reverse. append line 1 to line 2. | dwalley | Shell Programming and Scripting | 7 | 08-04-2008 07:11 AM |
|
|