在mySQL中不显示年份值(Not showing Year values in mySQL)
我试图从下面的命令行导入csv文件中的数据,保存在E驱动器中,文件名为data.csv:
LOAD DATA LOCAL INFILE 'E:\data.csv' into table prize_won fields terminated by ',' lines terminated by '\n';
数据文件分别具有年份,主题,赢家,国家和类别。 现在,当我尝试用上面的命令导入它时,有些年份没有在表格中显示,有些是可见的,但其余条目看起来很好。
你能否建议一个可能的解决方案?
我的data.csv文件内容看起来像
1970 Physics Hannes Alfven Sweden Scientist 1970 Physics Louis Neel France Scientist 1970 Chemistry Luis Federico France Scientist 1970 Physiology Ulf von Euler Sweden Scientist
I am trying to import data from csv file with below command line for data which is kept in E drive and file name is data.csv:
LOAD DATA LOCAL INFILE 'E:\data.csv' into table prize_won fields terminated by ',' lines terminated by '\n';
The data file has headers Year,subject,winner,country and category respectively. Now when i try to import it with above command, some year aren't showing in tables and some are visible however rest of entries seems fine.
Can you please suggest a possible solution?
My data.csv file contents look like
1970 Physics Hannes Alfven Sweden Scientist 1970 Physics Louis Neel France Scientist 1970 Chemistry Luis Federico France Scientist 1970 Physiology Ulf von Euler Sweden Scientist
原文:https://stackoverflow.com/questions/43412178
更新时间:2022-11-23 17:11
最满意答案
我认为你想要做的是:
aNumber = input('Enter a number: ') anotherNumber = input('Enter another number: ') print(int(aNumber) + int(anotherNumber))
要使用stdin / out执行此操作,可以使用:
import sys print("Inputs:") one = sys.stdin.readline() two = sys.stdin.readline() print("Output:") three = int(one) + int(two) four = str(three) sys.stdout.write(four)
I think what you're trying to do is:
aNumber = input('Enter a number: ') anotherNumber = input('Enter another number: ') print(int(aNumber) + int(anotherNumber))
To do this using stdin/out you can use:
import sys print("Inputs:") one = sys.stdin.readline() two = sys.stdin.readline() print("Output:") three = int(one) + int(two) four = str(three) sys.stdout.write(four)
相关问答
更多-
使用依赖注入。 将它与泛型和单态相结合,你不会失去任何性能: use std::io::{self, BufRead, Write}; fn prompt
(mut reader: R, mut writer: W, question: &str) -> String where R: BufRead, W: Write, { write!(&mut writer, "{}", question).expect("Unable to write"); let mu ... -
是否可以将stdout重定向为stdin到同一个程序?(Is it possible to redirect stdout as stdin to same program?)[2022-03-05]
是的,您可以在任何POSIX系统中为自己创建管道 。 但是没有免费的午餐。 如果你需要存储数据,它必须去某个地方。 管道由OS管理的缓冲区支持。 您可以将管道的末端设置为返回stdin和stdout (如Joachim的答案),但我建议不要这样做,因为它会覆盖程序的常用输入和输出通道。 (C和任何POSIX服务都不会“播放”流,因此用户可以看到它,并让它在程序内回显。) Yes, you can create a pipe to yourself in any POSIX system. But there ... -
基于@ w0xx0m和@Martin Prikryl的帮助,我设法制作了这个有效的解决方案: Register-ObjectEvent -InputObject $process ` -EventName OutputDataReceived -SourceIdentifier processOutputDataReceived ` -Action { $data = $EventArgs.data if($data -ne $null) { Write-Host $data ...
-
您可以打印\r来删除提示:它会将光标返回到当前行的开头。 然后,您可以打印输出,然后打印一些空格以清除任何剩余的输入字符,换行符,并重新打印提示。 使用ANSI序列或终端专用库,您可以做更多,但我认为只有使用ASCII才能可靠地完成所有这些。 当然,除了打印242个空行以重绘整个屏幕。 编辑:对不起,我没有正确回答ANSI部分。 使用光标移动控制代码和现有字符上的打印空间,您几乎可以执行任何操作,并且有一些便利操作可以帮助您,例如“删除行”。 但请记住,Windows不能与ANSI post XP一起使用, ...
-
为了理解发生了什么,请考虑这些是跨过程边界的通信渠道。 我会避免称它们为流,因为它们在不同的上下文中使用,但它们是相关的。 现在,首先,filedescriptor只是表示这些通道的特定于流程的表的索引,它们基本上是一种不透明的句柄。 但是,这是第一个答案:由于线程是进程的一部分,它们也共享这些描述符,所以如果你从两个线程写入同一个通道,它会通过相同的通道离开,所以在进程之外,两个线程无法区分。 然后,当调用fork()时,将有效地复制该进程。 这是通过写时复制优化完成的,但仍然意味着它们也有不同的表来表示 ...
-
二进制stdin和stdout(Binary stdin and stdout)[2022-04-03]
在Perl中,你可以试试: perl -ne 'chomp; print pack 'i', $_;' 这将给你一个至少32位的主机本地有符号整数,但可能更多取决于你的本地C编译器。 其他可以打包的选项可以代替'i' ,比如'l' ,这会给你一个长的签名,这应该是32位的。 还有更多的小端或大端的选择。 有关完整说明,请参阅http://perldoc.perl.org/functions/pack.html 。 这里是你在C中的解决方案,以防你想以无聊的方式去做。 :) #include要将source输出作为输入传递给run_command sink因为run_command必须在您的情况下运行接收sink之前结束: source | { run_command &>/dev/null; sink; } To pass the output from source as an input to sink given that run_command must end before sink is run in your case: source | { run_command &>/d ...如何使用stdin和stdout输入并显示其总和(How to take inputs and display their sum using stdin and stdout)[2023-11-30]
我认为你想要做的是: aNumber = input('Enter a number: ') anotherNumber = input('Enter another number: ') print(int(aNumber) + int(anotherNumber)) 要使用stdin / out执行此操作,可以使用: import sys print("Inputs:") one = sys.stdin.readline() two = sys.stdin.readline() print("Outp ...重新标记stdout和stdin(Redericting stdout and stdin)[2024-03-30]
您不想分配给stdout 。 相反,你(可能)想要使用freopen ,在你的情况下,如: freopen("/home/user/file.txt","w", stdout); 如果/当您在内部进行所有处理时,通常最好编写代码以接收FILE *作为参数,并传递正确的值。 当你有外部代码直接写入stdout时,这不起作用。 编辑:我可能还应该提到freopen另一个严重问题 - 没有提供方法将其恢复到上一个流。 这是你再次使用freopen ,并知道将写入控制台(或其他)的路径。 You don't wan ...这让我想起了一段时间我写的剧本 。 虽然它可能会为您(或其他人)带来灵感,但却无法满足您的需求。 它包含的是一个如何读取流输出的示例,而不必关闭任何流。 也许您可以对您的情况应用相同的逻辑: $allInput = array( 'load excalc; operator x; x(0) := t; x(1) := r;' );//array with strings to pass to proc if (is_resource($process)) { $output = ''; ...相关文章
更多- mysql问题
- 关于netbeans和mysql的问题
- my php & mysql FAQ
- Hadoop 中利用 MapReduce 读写 MySQL 数据
- 关于mysql 的 sql
- MapReduce直接连接MySQL获取数据
- 通过Sqoop实现Mysql / Oracle 与HDFS / Hbase互导数据
- 关于mysql数据库memory表数据重复问题
- MySQL用户与授权
- shell操作mysql初步
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。