Three steps...
Find:\n\n
Replace:__NEWLINE__
Find:\n
Replace:\t
Find:__NEWLINE__
Replace:\n
Main Topics
Browse All TopicsI have a massive text file I need to import into SQL. Unfortunately, it is broken up one field per line, with a double line break between records. It looks like the code below.
I don't know how to import this into SQL directly, but I'm hoping to clean it up in TextPad a bit ...
I'd like to get it down to one real "row" per line, with a pipe delineating the lines, and a tab delineating the columns. I need the regex expression to basically find instances where there are characters followed by a new line (I've tried: [A-Z0-9._%+-,;][\n] ) and replace it with that same text followed by a tab (I've tried: \0\t)
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
If it is crashing in Find:\n Replace:\t then the file is too big for textpad to handle. You can test it in a smaller sample just o ensure that you are selecting proper options.
Have you tried loading this file as is in SQL? What version of SQL server are you using? You may be able to use \n as column delimiter and \n\n as row delimiter. It should work in SQL 2005 onwards.
Business Accounts
Answer for Membership
by: mrjoltcolaPosted on 2009-06-05 at 12:47:37ID: 24559614
Can you clarify if "field 1:" etc. is part of the data, or is the data like:
apple
pear
whatever
this
that
the other