Converting CSV to tab delimited with TP

General questions about using TextPad

Moderators: AmigoJack, helios, bbadmin, Bob Hansen, MudGuard

Post Reply
User avatar
kengrubb
Posts: 324
Joined: Thu Dec 11, 2003 5:23 pm
Location: Olympia, WA, USA

Converting CSV to tab delimited with TP

Post by kengrubb »

I'm using TP to convert a CSV (Comma Separated Values) file to a tab delimited file.

I first performed this RE Replace until no more lines were changed.

Find what: "([^,"\r\n]+),([^"\r\n]+)"
Replace with: "$1\xFF$2"

This was to convert commas delimited between double quotes (") to \xFF (ÿ), which was not in the file.

Then this RE Replace.

Find what: ,
Replace with: \t

This was to convert commas which are true delimiters to \t (tab).

Finally this RE Replace.

Find what: \xFF
Replace with: ,

This was to convert commas within double quote delimiters back to commas.

I suppose Excel 2010 could do this, but it's an almost 900 MB file and I tend not to trust tools that convert stuff and "help me" when I want to see the really, real bytes. Hence, I use TP for such tasks.
(2[Bb]|[^2].|.[^Bb])

That is the question.
User avatar
kengrubb
Posts: 324
Joined: Thu Dec 11, 2003 5:23 pm
Location: Olympia, WA, USA

Post by kengrubb »

Duh moment.

My question was, could others suggest potential problems or issues with this approach? Are there things I'm missing?

Running Win7 Ent 64bit and TP 7.4.0 64bit
(2[Bb]|[^2].|.[^Bb])

That is the question.
User avatar
kengrubb
Posts: 324
Joined: Thu Dec 11, 2003 5:23 pm
Location: Olympia, WA, USA

Post by kengrubb »

My grand plan appeared to fall apart in TP, but I seem to have recovered fully in WE.

Note to self and others, when working with 800MB or larger files, use WE instead of TP.

One of the niceties of both TP and WE using ECMA Regex is that what works in one will work in the other.
(2[Bb]|[^2].|.[^Bb])

That is the question.
Ryck
Posts: 50
Joined: Thu Mar 17, 2005 4:20 am

Post by Ryck »

kengrubb wrote:My grand plan appeared to fall apart in TP, but I seem to have recovered fully in WE.

Note to self and others, when working with 800MB or larger files, use WE instead of TP.

One of the niceties of both TP and WE using ECMA Regex is that what works in one will work in the other.
I think that's what WildEdit was for. I never knew what the file size limit was. 800 MB is a good benchmark. Probably 500 MB with my system. LOL
Post Reply