Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-19-2012, 09:43 PM
deboo deboo is offline Add line numbers to end of each line Windows XP Add line numbers to end of each line Office 2007
Novice
Add line numbers to end of each line
 
Join Date: Aug 2012
Posts: 3
deboo is on a distinguished road
Question Add line numbers to end of each line


I have a word 2007 file having text in an Indian language (Hindi) containing line numbers on each line. About 12 pages. Some lines are bolded, some are italicized and others are colored.

What I want is to sort text in Hindi first but retain the line numbers. This is not possible I guess since the numbers will remain at their place. Sorting of text is fine, though.

The next best thing I can do is copy the text along with line numbers into wordpad and back to word, then sort the text. But this way, the sorting is done based on numbers and not text.

Another thing I can do is to remove the line numbers from the start of each line and add the line numbers to end of each line, say in brackets. But doing this manually is extremely tedious.

I am aware that this can be done easily in Linux/UNIX using the sed tool but even if I had Linux installed, and used sed to do this, I'd had to loose the formatting of my text.

Is there anyway that I can do what I want in Word itself, without having to do it manually for each line?
Reply With Quote
  #2  
Old 08-20-2012, 06:05 AM
macropod's Avatar
macropod macropod is offline Add line numbers to end of each line Windows 7 64bit Add line numbers to end of each line Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You may be able to use a wildcard Find/Replace to swap the numbers and text but, without seeing the document with some representative content, I can't really say for sure.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 08-20-2012, 06:24 AM
macropod's Avatar
macropod macropod is offline Add line numbers to end of each line Windows 7 64bit Add line numbers to end of each line Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Cross-posted at: http://www.techsupportforum.com/foru...ne-661573.html
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 08-20-2012, 10:56 AM
deboo deboo is offline Add line numbers to end of each line Windows XP Add line numbers to end of each line Office 2007
Novice
Add line numbers to end of each line
 
Join Date: Aug 2012
Posts: 3
deboo is on a distinguished road
Arrow

Well I thought that cross-posting is only within a forum. I posted in the other one so as to get a reply just in case I didn't get here. Anyway, thanks for the etiquette link.

I was able to get some results by copy-pasting the content into Excel and then back into word, but this way it takes quite an effort to properly adjust the columns and cells etc.

I'd like to know your method in detail, so I'm attaching the first page of the document here. Please see if your method works, and let me know.

Thanks and Regards,
Deboo
Attached Files
File Type: docx Geeton_ke_rang_Baba_ke_sang_1st_page.docx (26.5 KB, 7 views)
Reply With Quote
  #5  
Old 08-20-2012, 03:37 PM
macropod's Avatar
macropod macropod is offline Add line numbers to end of each line Windows 7 64bit Add line numbers to end of each line Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

See attached.

As you were using list numbering, a different approach was required.
1. Delete the list numbering and insert a tab charcter at the end of the 1st numbered line.
2. Turn the contents into a two-column table, with tab separators to create an empty 2nd column
3. Apply the list numbering to the second column.
It was a little more fiddly than that to get the layout correct, but the above covers the essentials.
Attached Files
File Type: docx 1st_page.docx (30.6 KB, 9 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 08-20-2012, 04:19 PM
deboo deboo is offline Add line numbers to end of each line Windows XP Add line numbers to end of each line Office 2007
Novice
Add line numbers to end of each line
 
Join Date: Aug 2012
Posts: 3
deboo is on a distinguished road
Arrow

Numbers at the end of each line is not the only thing I wanted to do. Once you do the text based sorting, the numbers remain as they were, before the sorting, making the numbers useless (as this is a list of songs on an MP3 DVD).

I'm attaching the file you sent, after sorting the text. See if you can do something so that the numbers also move along with the text when I do the sorting. You won't have the sorting available in Hindi unless you install the Indic language support I guess.

Thanks for your valuable time.

Kind Regards,
Deboo
Attached Files
File Type: docx 1st_page.docx (29.2 KB, 6 views)
Reply With Quote
  #7  
Old 08-20-2012, 07:35 PM
macropod's Avatar
macropod macropod is offline Add line numbers to end of each line Windows 7 64bit Add line numbers to end of each line Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

It would have been helpful if you had said at the outset what the requirements are. You can still use the same basic approach, though - just skip step 3 and, instead, run the following macro:
Code:
Sub Number()
Dim i As Long
With ActiveDocument.Tables(1)
  For i = 1 To .Rows.Count
    .Columns(2).Cells(i).Range.Text = i
  Next
End With
End Sub
For installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
line numbers, text manupulation, word2007



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trend Line uhlersa Excel 0 05-10-2011 06:17 PM
Add line numbers to end of each line I indent second line and the first line indents, help. DerekUD Word 1 05-06-2011 11:26 PM
Add line numbers to end of each line How to paste into another app without line numbers? Moonf4 Word 1 04-18-2011 03:16 PM
First line on page is truncated (top of line) OwlCat1212 Word 0 02-14-2011 03:24 PM
Add line numbers to end of each line Line breaks at each line in Web text ahazelwood Word 5 01-06-2011 02:37 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:57 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft