怎样把csv文件中的warning去掉?

获得一批csv文件,前面有不知道什么原因产生的warning,但是后面的行数据都是正确的,请问如何把前面的warning删除掉?
谢谢
怎样把csv文件中的warning去掉?

2022-01-21 12:14:09,950 main WARN JNDI lookup class is not available because this JRE does not support JNDI. JNDI string lookups will not be available, continuing configuration. java.lang.ClassNotFoundException: org.apache.logging.log4j.core.lookup.JndiLookup

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:264)

at org.apache.logging.log4j.util.LoaderUtil.loadClass(LoaderUtil.java:122)

at org.apache.logging.log4j.util.LoaderUtil.newInstanceOf(LoaderUtil.java:141)

at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:168)

at org.apache.logging.log4j.core.util.Loader.newCheckedInstanceOf(Loader.java:301)

at org.apache.logging.log4j.core.lookup.Interpolator.<init>(Interpolator.java:95)

at org.apache.logging.log4j.core.config.AbstractConfiguration.<init>(AbstractConfiguration.java:116)

at org.apache.logging.log4j.core.config.DefaultConfiguration.<init>(DefaultConfiguration.java:46)

at org.apache.logging.log4j.core.layout.PatternLayout$Builder.build(PatternLayout.java:492)

at org.apache.logging.log4j.core.layout.PatternLayout.createDefaultLayout(PatternLayout.java:376)

at org.apache.logging.log4j.core.appender.ConsoleAppender$Builder.<init>(ConsoleAppender.java:168)

at org.apache.logging.log4j.core.appender.ConsoleAppender.newBuilder(ConsoleAppender.java:160)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.createBuilder(PluginBuilder.java:152)

at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:119)

at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:918)

at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:858)

at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:850)

at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:479)

at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:219)

at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:231)

at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:496)

at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:566)

at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:582)

at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:217)

at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:152)

at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)

at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)

at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:103)

at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:43)

at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:42)

at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)

at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)

at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:301)

at org.apache.hadoop.util.RunJar.<clinit>(RunJar.java:54)

A,B,C,D,E

以下正常,以下正常,以下正常,以下正常,以下正常

以下正常,以下正常,以下正常,以下正常,以下正常

以下正常,以下正常,以下正常,以下正常,以下正常

以下正常,以下正常,以下正常,以下正常,以下正常

以下正常,以下正常,以下正常,以下正常,以下正常


回答:

这个数据处理没什么难度啊。你要做的事是观察这些文件格式是否差不多,如果是,那解决方案可能就有很多种。找找规律和可行的代码,这几个可能是可行的(得根据文件来,你说只有最前面有):

  1. 文件比较小,直接读然后根据 \n\n\n 这种分割,然后第二段 strip 一次就是你的 CSV 了
  2. 文件比较大,按行读,如果你的 CSV 表头是固定的,那你一直读到出现表头就行。如果没有,那可以尝试检测上一行是空行,或者这些行不已 \s+at 开头这种。

以上是 怎样把csv文件中的warning去掉? 的全部内容, 来源链接: utcz.com/p/938253.html

回到顶部