Stuck on solution

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

Garren

Stuck on solution

Postby Garren » Sat Apr 24, 2004 7:31 am

I have a single file with a bunch of addresses and other info in them. This file is used in another process but I need the name and date to be on the same line.

Here is the first example:

JESSICA SMITH P 05-23-02
123 Main Street
VICTORIA BC 1550.00
V8V-1B9 CANADA RI 00001

notice the name and address are on the same line. Here is the second example:

P 05-23-02
WILLIAM JONES
191 MAIN ST 2222.00
BRISTOL NH 03222

When there are only 3 address lines the name and date aren't on the same line. I need a way for when there are only 3 address lines to delete the date line and insert it on name line or move the address lines up to the date line.

I noticed the BB reformated my text so here is an image of how the text with spaces is in the file:
Image

Any ideas?
Thanks,
Garren

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Mon Apr 26, 2004 11:59 am

Hi Garren,

Use a pattern match to find lines with say, 30 or more spaces followed by the P, then the date eg

[ ]{30,}P([^\r\n]*)\r\n([^\r\n]*?)

Replace with

$2 $1
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Baidu [Spider], Yahoo [Bot] and 2 guests