首页 \ 问答 \ 删除列表中单词末尾的\ n和后面的字母(Delete the \n and following letters in the end of words in a list)

删除列表中单词末尾的\ n和后面的字母(Delete the \n and following letters in the end of words in a list)

如何删除\n和以下字母? 非常感谢。

wordlist = ['Schreiben\nEs', 'Schreiben', 'Schreiben\nEventuell', 'Schreiben\nHaruki']
for x in wordlist:
    ...?

How can I delete the \n and the following letters? Thanks a lot.

wordlist = ['Schreiben\nEs', 'Schreiben', 'Schreiben\nEventuell', 'Schreiben\nHaruki']
for x in wordlist:
    ...?

原文:https://stackoverflow.com/questions/1966495
更新时间:2023-08-20 12:08

最满意答案

我使用TERADATA SQL Assistant中提供的IMPORT功能将数据加载到Teradata中。

但是处理这些数据我不确定下面我解释的方法是否足够有效。

但是,您可以尝试以下内容:

如果您使用的是TERADATA SQL Assistant:

  1. 转到文件菜单 - >单击IMPORT选项
  2. 您应该准备好一个表,其中包含CSV文件中所有必需的列以及正确的数据类型。
  3. 在SQL Assistant中,编写以下查询:

INSERT INTO TABLE_NAME VALUES(?,?,?,?....);

  1. 执行上述查询后,TERADATA会询问您要从中导入数据的文件,只需浏览并选择文件即可开始导入。

PS:由于你有12米的记录,肯定会花费很多时间。


I have loaded data into Teradata using the IMPORT function available in the TERADATA SQL Assistant.

But handling this amount of data I am not sure whether the method I explain you below will be efficient enough.

However, you may try something like the below:

If you are using TERADATA SQL Assistant:

  1. Goto FILE menu-> click IMPORT option
  2. You should have a table ready with all the required columns in your CSV file and correct datatype.
  3. In SQL Assistant, write the below query:

INSERT INTO TABLE_NAME VALUES(?,?,?,?....);

  1. Once you execute the above query TERADATA will ask for the file from which you want to import the data, you just need to browse and select your file and the import will begin.

P.S: Since you have 12 m records, it will definitely take lot of time.

相关问答

更多
  • 您的查询中没有ORDER BY,因此您只需要100个随机行? 在Teradata中,TOP在完整结果集创建后完成。 您应该将TOP移动到派生表中,如: select I.item_sku_nbr,L.loc_nbr,MIS.MVNDR_PRTY_ID from QA_US_MASTER_VIEWS.item I, qa4_US_MASTER_VIEWS.location L, (SELECT TOP 100 * FROM qa4_US_MASTER_VIEWS.item_str) IST, qa4_US_ ...
  • 我使用TERADATA SQL Assistant中提供的IMPORT功能将数据加载到Teradata中。 但是处理这些数据我不确定下面我解释的方法是否足够有效。 但是,您可以尝试以下内容: 如果您使用的是TERADATA SQL Assistant: 转到文件菜单 - >单击IMPORT选项 您应该准备好一个表,其中包含CSV文件中所有必需的列以及正确的数据类型。 在SQL Assistant中,编写以下查询: INSERT INTO TABLE_NAME VALUES(?,?,?,?....); 执行上 ...
  • 没关系,它使用与占位符“{}”一起工作的新方法。format() Working Query:session.execute(“select a_table from a_table where a_column in {}”。format(value)) Never mind, it worked using the new way of working with place holders "{}".format() Working Query: session.execute("select dist ...
  • Teradata中没有CREATE EXTERNAL TABLE 。 唯一能够直接导出CSV的工具是TPT(Teradata Parallel Transporter)。 否则,您必须使用SELECT TRIM(col1) || ',' || TRIM(col2)...在查询中执行concat SELECT TRIM(col1) || ',' || TRIM(col2)... SELECT TRIM(col1) || ',' || TRIM(col2)...然后根据客户端的功能导出。 There's no ...
  • 使用Teradata DB本身 - 没有。 然而:),Teradata提供所谓的UDA ( 统一数据架构 ),其中Teradata,Aster DB和Hadoop(HDFS)相互连接,几乎可以无缝地协同工作:)。 通常,如果您只想使用非结构化数据,请选择Aster。 这是Teradata的产品,您可以直接与HDFS连接。 HDFS在这里用作廉价且快速的数据存储。 更有趣的解决方案将提出新的Aster版本(6),其中将实现AFS ( Aster文件系统 )。 ASR是一种类似于HDFS的分布式文件系统。 我也 ...
  • 如果列定义为GENERATED BY DEFAULT则可能已直接插入负值。 如果它是GENERATED ALWAYS没有NO CYCLE且已达到MAXVALUE ,它将再次以MINVALUE开始,默认情况下min和max基于数据类型的可能范围。 IDENTITY列几乎不在Teradata中使用,根据您的需要决定是否需要保留它们。 If the column is defined as GENERATED BY DEFAULT the negative values might have been inser ...
  • Teradata为Cloudera( 链接 )和Hortonworks( 链接 )提供连接器,便于在平台之间移动数据。 QueryGrid是Teradata提供的产品,可让您在Teradata平台上创建“链接服务器”。 使用这些“链接服务器”,您可以从Teradata查询Hadoop平台上的数据。 目前,这些类型的工作负载旨在降低并发性。 这种情况发展得相当快,随着技术的发展和成熟,并发率可能会提高。 Teradata offers connectors for Cloudera (link) and Ho ...
  • 你需要EXEC声明: PROC SQL; CONNECT TO TERADATA(user="user" password="pw" server ="Teradata.something.somehwere"); EXEC( ) BY TERADATA; EXEC( Commit ) BY TERADATA; /* this is needed if the above state ...
  • SQL Assistant不会通过版本14.x显示对象之间的关系。 根据我使用Teradata的经验,关系已经在适当的建模工具中建模。 如果您的环境强制实施参照完整性,那么可以在SQL Assistant中查询可以在SQL Assistant中查询的视图,以帮助向您显示关系。 但是,结果将以表格形式表示,就像对数据库的任何其他查询一样。 DBC.All_RI_Children DBC.All_RI_Parents DBC.RI_Child_Tables DBC.RI_Distinct_Children DB ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)