dongtan9066 2012-09-03 13:01
浏览 41
已采纳

似乎无法摆脱mysql中新的空白行

EDIT:

For those having issues with mysql data that won't get rid of white spaces between rows. It's because of deep tabbed indents due to an issue when copy pasting from editors/word documents.

http://bugs.mysql.com/bug.php?id=49611

Here is the bug that doesn't allow me to fix this issue, it's because of deep indents, it's a MYSQL bug that won't be fixed.

PS: Message to community, Thanks to the guys that downvoted this question without giving time to properly formulate the issue. It's a debug process, you can let people know if you need something instead of acting rude and attacking the questioner, after all as the poster I'm likely to read and see what you need. If I knew what was needed to diagnose the issue, I would've found it and would not be posting here. Since I posted here, it means I don't know where to look as to identify if the issue is a MYSQL one or a PHP one. Be polite with your community guys, don't act like wolves trying to bite someone's head off all the time because they didn't give you everything you wanted right off the bat.. Take care.


Here is the raw paste from the database:

    one two three











one two three





one two three





one two three





one two three

Why is it still being like this? I str_replaced  's and 's . I don't want to get rid of 2 's due to the format of the text I need in between the text.

The result I'm looking for is :

 one two three

 one two three

 one two three
 one two three

Meaning max 2 's.

  • 写回答

1条回答 默认 最新

  • douyeke2695 2012-09-03 13:05
    关注

    This might be what you are after:

    $normalized = preg_replace('~(?
    ?){3+}~', "
    
    ", $original);
    

    But hey, it's hard to say. You want to keep stack overflow a happy place, you put some effort to posting a question.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP