Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-20-2022, 11:55 AM
RAJESH@1960 RAJESH@1960 is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2019
Novice
How to Draw a line at every change in date in the document
 
Join Date: Oct 2022
Location: INDIA
Posts: 13
RAJESH@1960 is on a distinguished road
Post How to Draw a line at every change in date in the document

Hello everyone,


I want to convert this data, which is converted from pdf, in word into a table but I am not getting the lines connected to each date in one row. Is there any other way to separate the rows at each change in data and getting the full data of that date in one row.? There are more than 500 dates in the original document. I would really appreciate it if anyone can show me an easier way to do it in one go.
Thank you in advance.
Attached Files
File Type: docx Draw line above each date.docx (63.5 KB, 8 views)
Reply With Quote
  #2  
Old 10-20-2022, 02:42 PM
macropod's Avatar
macropod macropod is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Since your data are in a Word table, all you need do is use the table tools to apply a border to each row. Simple as.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-20-2022, 03:19 PM
Guessed's Avatar
Guessed Guessed is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Are you asking how to remove the leading or trailing the paragraph marks from the table cells? That would allow the dates to align with the tops of the other cells in each row.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #4  
Old 10-20-2022, 09:10 PM
RAJESH@1960 RAJESH@1960 is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2019
Novice
How to Draw a line at every change in date in the document
 
Join Date: Oct 2022
Location: INDIA
Posts: 13
RAJESH@1960 is on a distinguished road
Default

I tried inserting a table but the values of one date is getting mixed up with the adjacent dates. I tried inserting the border too I got the same result.
Attached Images
File Type: png border.png (43.7 KB, 18 views)
Reply With Quote
  #5  
Old 10-20-2022, 10:01 PM
Guessed's Avatar
Guessed Guessed is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

It isn't clear what your problem is but I'm going to assume that you are finding the table rows are happening in the wrong places.

The easiest fix is going to be working on the conversion step from PDF. There are multiple ways to convert PDF depending on the applications you have at your disposal.

Have you tried converting the PDF into Excel rather than Word? Or try some different methods of conversion?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #6  
Old 10-20-2022, 10:03 PM
RAJESH@1960 RAJESH@1960 is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2019
Novice
How to Draw a line at every change in date in the document
 
Join Date: Oct 2022
Location: INDIA
Posts: 13
RAJESH@1960 is on a distinguished road
Default

Yes. I tried to convert it to excel but I faced the same problem. I even tried notepad++ but that was also too far from good and needed a lot of cleaning.
Reply With Quote
  #7  
Old 10-20-2022, 10:06 PM
RAJESH@1960 RAJESH@1960 is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2019
Novice
How to Draw a line at every change in date in the document
 
Join Date: Oct 2022
Location: INDIA
Posts: 13
RAJESH@1960 is on a distinguished road
Default

I have regularly been converting a lot of bank statements and customize them but a few bank statements just don't display the data in the required order. Hence, a lot of cleaning the excel sheet takes a lot of my time.
Reply With Quote
  #8  
Old 10-22-2022, 08:41 AM
RAJESH@1960 RAJESH@1960 is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2019
Novice
How to Draw a line at every change in date in the document
 
Join Date: Oct 2022
Location: INDIA
Posts: 13
RAJESH@1960 is on a distinguished road
Default

Can anyone at least suggest how to insert a line at every line.
Or
How do I remove the table and get the data without the table.?
Reply With Quote
  #9  
Old 10-22-2022, 03:39 PM
macropod's Avatar
macropod macropod is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Converting the table to text is unlikely to resolve your problems.

The following macro will repair all except the last row of your table:
Code:
Sub FixTable()
Application.ScreenUpdating = False
Dim r As Long, c As Long, RngSrc As Range, RngTgt As Range
With ActiveDocument.Tables(1)
  For r = .Rows.Count To 3 Step -1
    IsDate (Trim(Split(.Cell(r, 1).Range.Text, vbCr)(0)))
    If IsDate(Trim(Split(.Cell(r, 1).Range.Text, vbCr)(0))) = False Then
      For c = 1 To .Rows(r).Cells.Count
        Set RngSrc = .Cell(r, c).Range
        If RngSrc.Paragraphs.Count > 1 Then
        RngSrc.End = RngSrc.Paragraphs(1).Range.End - 1
        Set RngTgt = .Cell(r - 1, c).Range
        With RngTgt
          .End = .End - 1
          .Collapse wdCollapseEnd
          .FormattedText = RngSrc.FormattedText
          .InsertBefore " "
        End With
        RngSrc.Paragraphs(1).Range.Text = vbNullString
        End If
      Next
    End If
  Next
End With
Application.ScreenUpdating = True
End Sub
For PC macro installation & usage instructions, see: Installing Macros
For Mac macro installation & usage instructions, see: Word:mac - Install a Macro
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #10  
Old 10-22-2022, 06:29 PM
RAJESH@1960 RAJESH@1960 is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2019
Novice
How to Draw a line at every change in date in the document
 
Join Date: Oct 2022
Location: INDIA
Posts: 13
RAJESH@1960 is on a distinguished road
Default

Paul. Thanks for writing the macro. What is the macro exactly for. ? I don't see much change in the table. After inserting the code in a module, the rows are still not in the order as per date. I also tried copying the document to excel and the values at each row at each change in display are not showing in order. The value connected to one date is merged with the next date.
This is the first time I have inserted a module in the word document and saved it as Word micro enabled document. I hope I have done it right.
Attached Images
File Type: png word.png (47.1 KB, 15 views)
Reply With Quote
  #11  
Old 10-22-2022, 11:24 PM
macropod's Avatar
macropod macropod is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

I suggest you check the before & after screenshots more closely. With 01-08-2018, for example, you'll see that all dates are now aligned to the top of the cell and, where it previously didn't, the first line of each multi-line cell has been moved to the previous row (see especially the narration column).

The process relies on the affected rows having two or more paragraphs in each cell, so it isn't foolproof and the results will still need visual checking, particularly for the cheque column.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #12  
Old 10-23-2022, 08:19 AM
RAJESH@1960 RAJESH@1960 is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2019
Novice
How to Draw a line at every change in date in the document
 
Join Date: Oct 2022
Location: INDIA
Posts: 13
RAJESH@1960 is on a distinguished road
Default

I checked the data after running the code. Only that particular row is right. All the other rows are not affected by the code. This is just a sample data. Imagine where there are more than 500 rows of data, then I will have to clean each and every row to get it right. If the sample data works accurately, I could try it on the original data.
As the document is converted into pdf and I am trying to convert the pdf to document once again, there has to be some way to get each transaction separated from each other at each change in date. I am just trying to know and understand the pattern how it was done.
The option in word document is also giving the same result if I convert it to table.
Reply With Quote
  #13  
Old 10-23-2022, 02:06 PM
macropod's Avatar
macropod macropod is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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 really need to pay more attention to the before & after conditions. Compare the following screenshots and you will find that, except for the last row, every row where the date was not at the top has changed.
Attached Images
File Type: png Tbl A.png (75.4 KB, 10 views)
File Type: png Tbl B.png (75.6 KB, 10 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #14  
Old 10-23-2022, 02:22 PM
RAJESH@1960 RAJESH@1960 is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2019
Novice
How to Draw a line at every change in date in the document
 
Join Date: Oct 2022
Location: INDIA
Posts: 13
RAJESH@1960 is on a distinguished road
Default

Paul I have manually completed the cleaning of the data. The 5 rows dated 02-08-2017 except the first row all others are mixed up. Lines PCD.. & Services are of one date in the 2nd and 3rd row dated 02-08-2017. The fourth row begins from Sent IMPS and the 5th row begins with Recd. IMPS. You have inserted the lines below the date. If you get the lines above the date then I think it will be good. I hope you understood the problem. Where there are multiple lines in one particular date it has to take the first line in the narration and then the next.
Reply With Quote
  #15  
Old 10-23-2022, 02:41 PM
macropod's Avatar
macropod macropod is offline How to Draw a line at every change in date in the document Windows 10 How to Draw a line at every change in date in the document Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Quote:
Originally Posted by RAJESH@1960 View Post
You have inserted the lines below the date.
I have NOT inserted lines below the dates -I have moved lines above the dates to the end of the rows above - which it seems is where they should be. But, as you haven't provided any screenshots or documents of your own showing what the before and after results should be, we can only guess at your requirements.

In any event, there is a limit to what one can do programmatically with such a mess. If you don't want to use the code I posted, that is up to you.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to draw a trendline but not show the original line? Sunny Rio Word 0 09-03-2022 05:55 PM
How to Draw a line at every change in date in the document How to draw a cross mark on a vertical line? kingston123 Drawing and Graphics 4 09-19-2018 03:44 AM
How to Draw a line at every change in date in the document How to draw double line border for a Cell phamh PowerPoint 2 10-21-2014 02:26 PM
How to Draw a line at every change in date in the document I draw a line, an arrow comes up instead ZapoTeX PowerPoint 1 11-06-2012 02:03 AM
How to Draw a line at every change in date in the document how to draw line diagram with x yr yl gsrikanth Excel 1 03-07-2012 05:50 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:54 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