Newbie request converting line by line text to CSV

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
mark spooner
Posts: 4
Joined: Mon Sep 08, 2003 5:13 pm
Location: Oxford, UK
Contact:

Newbie request converting line by line text to CSV

Post by mark spooner »

Hi

As a newbie to textPipe Pro I would like some help with the following problem I have been trying to work on for several hours no. It's probably quite simple, but I'm having a mental block.

Does anyone know what script filter step I need to add to accomplish the following:

I have several thousand names and addresses in an unstructured format. The bulk of the text I can reorgnise quite simply but the following has stumped me.

Any help would be much appreciated.

I would like to go from:

FROM:

Morgan Cole
Buxton Court 3, West Way
Oxford Oxfordshire
OX2 0SZ
01865 262600

TO:

"Morgan Cole","Buxton Court 3, West Way","Oxford Oxfordshire","OX2 0SZ","01865 262600"

I have thousands of 'records' in one text file all taking up five lines of text each.

The existing script filter so far is:

Filter List
-----------
Filter options
| [X] Log to file
| [X] Append to logfile
| Log filename: C:\BP\textpipe\install\textpipe.log
| Threshold 500
|
|--Input from Trial Run
|
|--Remove blanks from Start of Line
|
|--Replace [Website] with []
| [ ] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
|
|--Replace [TXT details] with []
| [ ] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
|
|--Replace [Map/Directions] with []
| [ ] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
|
|--Replace [Save details] with []
| [ ] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
|
|--** DISABLED ** Remove matching lines [• ]
| [ ] Include line numbers
| [ ] Include filename
| [ ] Match case
| [ ] Count matches
| Pattern type: 0
| Context before: 0
| Context after: 0
|
|--Remove blank lines
|
|--Replace [Tel: ] with []
| [X] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
|
|--Comment...
| Click >>Here<< or press F1 for help
|
| TextPipe uses 'filters' to perform changes to each file. A 'filter list' is a sequence of changes, like 3 different search and replace operations.
|
| You can add filters from the menus above - Convert, Add, Remove, Email, Replace, Special, Maps, Restrict.
|
| For:
| * Search/replace - look in the Replace Menu
| * Unix/DOS/Mainframe End-of-line conversion - look in the Convert Menu
| * Extract email addresses - look in the Email Menu
| * Remove HTML codes - look in the Remove Menu
| * Join (merge) files together - look in the Special Menu
| * Split files apart - look in the Special Menu
| * Join files and then sort them - add a Special Menu\Merge filter followed by a Special Menu\Sort filter
|
| Just click the menu item to add the filter.
|
| This filter is a comment filter that is useful to document what you are trying to achieve.
|
| Please read the text under the 'Comments' tab.
|
+--Output to clipboard


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

Post by DataMystic Support »

Try searching for pattern

([^\r\n]*)
([^\r\n]*)
([^\r\n]*)
([^\r\n]*)
([^\r\n]*)

Replace with

"$1","$2","$3","$4","$5"
mark spooner
Posts: 4
Joined: Mon Sep 08, 2003 5:13 pm
Location: Oxford, UK
Contact:

Line by Line text to CSV format

Post by mark spooner »

Hi Simon

Easy when you know how.I searched through all 400+ posts on the YAHOO Groups site to try and find a solution or some guidance and came so close but so far.

Thanks for your help.

Love TextPipe to bits. It saves so much time. What used to take hours to do now only takes minutes once a filter set has been tested and working.

Regards, Mark.
ITCS IT Consultancy Services
Security, Networking and Infrastructure Consultancy Services
TEL: 07796 134602
EML: <<mailto:mark@itcs.biz>>
WEB: <<http://www.itcs.biz/>>
Post Reply