Code2care : TechZone Apps & Tutorials

Convert SQL to CSV using Notepad++



SQL Script can be converted to CSV format using Notepad++ Editor using few simple steps using Find and Replace option. As no regular expressions are to be used, we can achieve this even with editors that do not have them.

Lets take a sample SQL script,

insert into my_sql_table (id,name,marks) values ('1','Joe','66');
insert into my_sql_table (id,name,marks) values ('2','Mark','45');
insert into my_sql_table (id,name,marks) values ('3','Steve','23');
insert into my_sql_table (id,name,marks) values ('4','Larry','57');
insert into my_sql_table (id,name,marks) values ('5','Smith','78');


Steps to Convert SQL Script to CSV Format


    Step 1 : Copy the fields values to a separate tab.


    Step 2 : Press Ctrl + F to open find and replace dialog, and move to replace tag, see to it that search mode is Normal. Now Find insert into my_sql_table (id,name,marks) values ( and replace with Blank.

    Find and Replace at start of query



    Step 3 : Now we need to find ); and replace with ;

    Find and Replace the EOL



    Step 4 : Now we have our CSV format almost ready, just copy the Step 1 : copied Table fields at the top of the file, the result is CSV.

    SQL now converted to CSV format




You can follow the similar steps for your SQL file and covert it to CSV easily.



Top




Posts related to notepadplusplus.


1. How to Do Column Mode Editing in Notepad++

2. Setting up Cloud feature with Notepad++

3. Base64 Encoding Decoding In Notepad++

4. Add blank lines after each lines using Notepad++ text editor

5. 97 Useful Notepad++ Keyboard Shortcuts List

6. Compare Files with Notepad++ Plugin

7. Convert SQL to CSV in Notepad++

8. 15 Notepad++ Editor alternatives for Mac OS X

9. Disable Control Scroll Zoom-in and Zoom-out in Notepad++

10. How to Convert CSV file to SQL Script using Notepad++

11. Using Document Map in Notepad++

12. Add Blank Lines Notepad++

13. How to remove blank lines from a file using Notepad++

14. Add Text at Start and End of Each Line Notepad++

15. Indent XML Formatting In Notepad++

16. Replace tabs by spaces or comma Notepad++

17. ASCII to HEX and HEX to ASCII Conversion Notepad++

18. Error opening file for writing Notepad++ Setup

19. Launch Notepad++ html document in any web browser

20. How to do Multi-Line Editing in Notepad++

    more...

Posts related to sql.


1. List of Open Source SQLite Editor for Mac OS X, Windows and Linux

2. Connection Failed: 1130 PHP MySQL Error

3. Mysql error 1064 TYPE=MyISAM encountered while SQL dump import

4. Convert SQL to CSV in Notepad++

5. How to find AUTO_INCREMENT fileds value in mysql table

6. SQLite with Android Easy to Understand Tutorial that covers Select, Insert, Update and Delete

7. Error 2003 Can't connect to MySQL server on localhost

8. SQLite Error: unknown command or invalid arguments: "open". Enter ".help" for help


Posts related to csv.


1. Convert SQL to CSV in Notepad++








Popular tags
android
x 175
eclipse
x 29
notepadplusplus
x 20
macosx
x 14
sharepoint
x 14
html
x 14
mac
x 13
androidstudio
x 11




1000+ C Programs     PHP Tutorial     JSON Tutorial     Swift Tutorial     India Pinocdes     About Us     Privacy Policy


Code2care © 2012-17