标签: newline

行尾的'^ M'字符

当我在Unix环境中运行特定的SQL脚本时,我在SQL脚本的每一行的末尾看到一个'^ M'字符,因为它回显到命令行.我不知道最初创建SQL脚本的操作系统.

造成这种情况的原因是什么?如何解决?

sql unix newline os-dependent line-endings

98
推荐指数
10
解决办法
11万
查看次数

在printf中Java的"%n"有什么用?

我正在阅读Effective Java,它%n用于所有地方的换行符.我\n在Java程序中使用了相当成功的换行符.

哪个'正确'?怎么了\n?为什么Java改变了这个C约定?

java printf newline

98
推荐指数
6
解决办法
8万
查看次数

如何将新行放入wpf TextBlock控件?

我正在从XML文件中提取文本,我想插入一些由textblock渲染为新行的新行.

我试过了:

<data>Foo bar baz \n baz bar</data>
Run Code Online (Sandbox Code Playgroud)

但是数据仍然显示没有新行.我设置的内容<data>通过.Text通过C#属性.

我需要在XML中放置什么才能在GUI中呈现新行?

我尝试过这样的手动设置XAML中的文本:

<TextBlock Margin="0 15 0 0" Width="600">
There &#10;
is a new line.
</TextBlock>
Run Code Online (Sandbox Code Playgroud)

虽然编码字符没有出现在GUI中,但它也没有给我一个新的界限.

c# wpf newline textblock

97
推荐指数
7
解决办法
12万
查看次数

如何在Delphi中的字符串中包含换行符?

我想创建一个跨越多行的字符串,以分配给Label Caption属性.这是如何在Delphi中完成的?

delphi newline

94
推荐指数
7
解决办法
15万
查看次数

对象摘要中的NewLine

问候

为属性/字段/方法等设置摘要时,是否可以在其中添加换行符?

/// <summary>
/// This is line 1
/// This is line 2
/// </summary>
public bool TestLine { get; set; }
Run Code Online (Sandbox Code Playgroud)

当我设置它时,它显示为鼠标悬停:

bool TestLine
This is line 1 This is line 2
Run Code Online (Sandbox Code Playgroud)

但我希望它显示为:

bool TestLine
This is line 1 
This is line 2
Run Code Online (Sandbox Code Playgroud)

我尝试过使用\n但不起作用.有没有办法完成这项工作?

c# newline summary

91
推荐指数
6
解决办法
3万
查看次数

回车/换行.Net资源文件(App_GlobalResources)

我在App_GlobalResources.resx文件中保留了几个文本.

文本必须是多行的,我需要让它们包含换行符.但是,当我读取内容时,所有换行都消失了(\r\n打印出来,而不是作为CRLF 10 13控制字符).

我知道\r\n当我阅读内容时,我可以通过重新替换(或其他任何事情)回到CRLF来解决这个问题,但我想知道为什么这些明显以文本为目标的resx文件会忽略控制字符 - 而且CRLF很重要 - 如果有人知道是否有设置或某些东西可以让它自然地工作.

resx newline line-breaks resource-files

89
推荐指数
4
解决办法
6万
查看次数

Perl的打印如何在默认情况下添加换行符?

在Perl中,我的大多数print陈述都采用了这种形式

print "hello." . "\n";
Run Code Online (Sandbox Code Playgroud)

有没有一种很好的方法可以避免让所有讨厌的人"躺着"?

我知道我可以创建一个新的功能,例如myprint自动附加\n,但如果我可以覆盖现有的那么会很好print.

printing perl newline

89
推荐指数
6
解决办法
13万
查看次数

在使用"text"属性对文件进行规范化后,如何强制git检出主分支并删除回车?

好的,所以我.gitattributes用这样的行添加了文件

*.css text
*.js text
etc...
Run Code Online (Sandbox Code Playgroud)

然后我按照http://git-scm.com/docs/gitattributes#_checking-out_and_checking-in上的说明进行操作

$ rm .git/index     # Remove the index to force Git to
$ git reset         # re-scan the working directory
$ git status        # Show files that will be normalized
$ git add -u
$ git add .gitattributes
$ git commit -m "Introduce end-of-line normalization"
Run Code Online (Sandbox Code Playgroud)

但是现在我的工作副本仍然有回车!我有未跟踪的文件,我想保留.如何使用规范化文件再次git checkout master分支?

我知道文件在存储库中是规范化的,因为当我克隆repo时,我有所有没有回车符的文件.

git newline core.autocrlf

89
推荐指数
2
解决办法
23万
查看次数

使用CSV Django模块以通用换行模式打开文件

我试图访问model.filefieldDjango 中使用该模块解析Python中的CSV文件csv.它在Windows上工作,但在Mac上它给了我这个:

Exception Type: Error

Exception Value: new-line character seen in unquoted field - do you need to open the file in universal-newline mode?
Run Code Online (Sandbox Code Playgroud)

这是代码:

myfile = customerbulk.objects.all()[0].fileup

mydata = csv.reader(myfile)
    for email,mobile,name,civilid in mydata:
        print email,mobile,name,civilid
Run Code Online (Sandbox Code Playgroud)

csv django macos newline python-2.x

86
推荐指数
1
解决办法
7万
查看次数

如何用curl发送换行符?

我已经尝试过以下方法来发送带有curl的换行符,但\n不会被curl解释.

curl -X PUT -d "my message\n" http://localhost:8000/hello
Run Code Online (Sandbox Code Playgroud)

如何使用curl发送换行符?

curl newline http

84
推荐指数
7
解决办法
7万
查看次数