MySQL Import data to txt

Source: Internet
Author: User
Tags mysql import

Select fdate,fminute,ftotal,ft200, (ft200+0.0)/ftotal from t_switch_155 ORDER by FDate asc,fminute ASC to outfile ' 15 5.txt ';

Then open with Notepad, you can see the whole. If you open with txt, a newline character may not exist.

If TXT has a string condition, then

[FID MSG] = fopen (' t_server13.txt '); xx = Textscan (FID, '%d%d%s%d%d%d%d ', [7 inf]); Fclose (FID);

So xx is a variable containing 5 cells, through Xx{1} xx{2} and so on, you can take each column in turn.

For example, the SH script written under Windows can be executed under Linux and may go wrong.

Workaround:

The reason is: Windows line break symbol is "\ r \ n", and Linux is "\ nthe" no "\ R", when the shell file is written under Windows, all the newline characters are "\ r \ n", the shell is not able to execute this file, will prompt the above error. Please perform ' file format conversion '-WINDOWS in Notepad.

Then use Matlab xx=load ('. txt ').

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.