Python cvs合并错误

Python cvs合并错误,python,csv,Python,Csv,我有一个csv数据(从xlsx转换为csv,但使用wordwrap,不知道如何在没有单元格wordwrap的情况下将每个xlsx行作为csv行),如下所示: 1099411,wlan: Possible leakage of original sequence numbers and source address of probe request frames affecting user privacy (Applicable to Android O or later) [FW],W

我有一个csv数据(从xlsx转换为csv,但使用wordwrap,不知道如何在没有单元格wordwrap的情况下将每个xlsx行作为csv行),如下所示:

    1099411,wlan: Possible leakage of original sequence numbers and source address of probe request frames affecting user privacy (Applicable to Android O or later) [FW],WConnect,WLAN Embedded SW,High,AdjacentNetwork,CWE-330 Use of Insufficiently Random Values,"The original mac spoofing feature does not use the following in probe request frames: (a) randomized sequence numbers and (b) randomized source address for cfg80211 scan, vendor scan and pno scan which may affect user privacy.","Turn ON the Wi-Fi and sniff the probe requests to find out the following:
(a) incremental (non-randomized) sequence numbers and
(b) original MAC address of the device",Publicly known,None,None,"Mac randomization refers to the randomization of probe request source address and sequence numbers.
This change implements Mac randomization to randomize probe request's source MAC address and sequence number in host, vendor and pno scans to maintain / improve user's privacy.

The change requires the framework (Android O or later) to actually set this feature","wlan_framegen.c
wlan_framegen.h
wlan_mgmt_local_txrx.c
wlan_mgmt_local_txrx.h
wlan_rtt.c
wlan_rtt.h
wlan_scan.c
wlan_scan_priv.h
wlan_scan_sm.c
wlan_vdev_keepalive.c",None,None
1079713,Buffer overflow vulnerability in ioctl V4L2_CID_PRIVATE_IRIS_SET_SPURTABLE,WConnect,FMHost,High,Local,CWE-120 Buffer Copy Without Checking Size of Input ('Classic Buffer Overflow'),"If larger than expected data is set by the user in SpurTableFile.txt, during the copy_from_user call in ioctl V4L2_CID_PRIVATE_IRIS_SET_SPURTABLE, a buffer overflow in kernel memory occurs.","1. Configure /etc/fm/SpurTableFile.txt file with more than expected data.
2. Launch FM app.","CVE-2016-5345, ANDROID-32639452
Reported by Aravind Machiry, an external researcher, to ASUS, who reported it to us. We thank them for bringing this issue to our attention.","Added stricter length check before invoking copy_from_user command to avoid copying data more than allocation. If length is out of range, an error is returned.",drivers/media/radio/radio-iris.c,None,None,"https://source.codeaurora.org/patches/quic/la/.PATCH_171295_QPSIIR_367_security_patch_20161109.tar.gz

","This vulnerability is planned to be publicly disclosed on 
2016-12-05 in the Android Security Bulletin 2016 December.","After downloading the patch, use OpenSSL to decrypt the file.

Symmetric key: z}aE]X4Qx9jL(I3VGiKO 

Example command: 
openssl enc -d -aes-256-cbc -in msm-3.18.git-af9a7c8e832f4dd1d366e31b716c8f9e89bde89f.patch -out msm-3.18.git-af9a7c8e832f4dd1d366e31b716c8f9e89bde89f.patch.txt -pass 'pass:z}aE]X4Qx9jL(I3VGiKO'","APQ8009 , APQ8009W , APQ8016 , APQ8026 , APQ8037 , APQ8039 , APQ8052 , APQ8053 , APQ8056 , APQ8076 , APQ8092 , APQ8094 , APQ8096 , APQ8096AU , APQ8096SG , APQ8098 , MDM9607 , MDM9628 , MDM9640 , MDM9645 , MDM9650 , MSM8108 , MSM8208 , MSM8209 , MSM8608 , MSM8909 , MSM8909W , MSM8916 , MSM8917 , MSM8926 , MSM8928 , MSM8929 , MSM8937 , MSM8939 , MSM8952 , MSM8953 , MSM8956 , MSM8976 , MSM8976SG , MSM8992 , MSM8994 , MSM8996 , MSM8996AU , MSM8996SG , MSM8998"
731393,Heap overflow vulnerability in MSM modem causing device crash,Modem,SEC,High,AdjacentNetwork,CWE-120 Buffer Copy Without Checking Size of Input ('Classic Buffer Overflow'),"During SSL handshake, a one byte heap overflow was detected by heap integrity check and resulted in a device crash. The filled area was extended 1 Byte but the requesting heap size was not changed. On Launching GoogleMap application, a crash was observed every time.",Launch GoogleMap application.,"CVE-2016-6726 ANDROID-30775830

This issue was reported to Google by a security researcher. We thank Google for bringing this issue to our attention.",Made changes to handle SubjectAltName validation of ServerCert.,sme_ssl_shared.lib,None,None,No,None,"APQ8009, APQ8009W, APQ8016, APQ8017, APQ8037, APQ8039, APQ8052, APQ8053, APQ8056, APQ8076, APQ8084, APQ8092, APQ8094, APQ8096, APQ8096AU, APQ8096SG, APQ8098, MDM9206, MDM9225, MDM9225M, MDM9230, MDM9235M, MDM9330, MDM9607, MDM9625, MDM9625M, MDM9628, MDM9630, MDM9635M, MDM9640, MDM9645, MDM9650, MDM9655, MSM8108, MSM8208, MSM8209, MSM8608, MSM8909, MSM8909W, MSM8916, MSM8917, MSM8926, MSM8928, MSM8929, MSM8937, MSM8939, MSM8940, MSM8952, MSM8953, MSM8956, MSM8976, MSM8976SG, MSM8992, MSM8994, MSM8996, MSM8996AU, MSM8996SG, MSM8998, SDX20M"
1114793,Out of Bounds Write on the Heap when Parsing an Interrogate (Supplementary Service) Packet,Modem,MMCP,Critical,AdjacentNetwork,CWE-20 Improper Input Validation,Buffer overflow occurs if the network sends more than 5 CCBS (completion of call to busy subscriber) feature list when UE interrogated the supplementary service.,"1. Power on and register on W or G
2. UE has interrogated supplementary service
3. Network sends RELEASE_COMPLETE with CCBS info having CCBS feature list more than 5 entries (non standard-compliant value)","CVE-2017-6211
Privately reported by Matt Spisak, an external researcher.","Added checks so that buffer overflow will not occur even if Network sends the CCBS entries more than 5, processing only those that are in range.",mn_ss_processing.c,None,None,No,None,"APQ8009, APQ8009W, APQ8016, APQ8017, APQ8026, 
APQ8037, APQ8039, APQ8052, APQ8053, APQ8056, 
APQ8076, APQ8084, APQ8092, APQ8094, APQ8096, 
APQ8096AU, APQ8096SG, APQ8098, MDM6200, MDM6600, 
MDM8215, MDM8215M, MDM8615M, MDM9206, MDM9215, 
MDM9225, MDM9225M, MDM9230, MDM9235M, MDM9310, 
MDM9330, MDM9607, MDM9615, MDM9615M, MDM9625, 
MDM9625M, MDM9628, MDM9630, MDM9635M, MDM9640, 
MDM9645, MDM9655, MSM8108, MSM8110, MSM8112, 
MSM8126, MSM8208, MSM8209, MSM8210, MSM8212,
MSM8226, MSM8228, MSM8608, MSM8610, MSM8612, 
MSM8626, MSM8628, MSM8905, MSM8909, MSM8909W, 
MSM8916, MSM8917, MSM8926, MSM8928, MSM8929, 
MSM8937, MSM8939, MSM8952, MSM8953, MSM8956, 
MSM8960, MSM8976, MSM8976SG, MSM8992, MSM8994, 
MSM8996, MSM8996AU, MSM8996SG, MSM8998, QSC6155, 
QSC6165, QSC6175, QSC6185, QSC6195, QSC6270, 
QSC6295, QSC6695, QSD8250, QSD8650"
2100627,Use of Out-of-range Pointer Offset in VP9 content playback,Multimedia,Video,High,Network,CWE-823 Use of out-of-range pointer offset,"On some hardware revisions where VP9 decoding is hardware-accelerated, the frame size is not programmed correctly into the decoder hardware which can lead to an invalid memory access by the decoder.","Play VP9 content with non-mod 8 resolution, e.g. http://i.cdn.turner.com/cnn/.e/interactive/html5-video-media/2017/07/05/icbm.webm","CVE-2017-11076,A-65049457. Reported by Google.",Code changes were in FW to program the byte-aligned frame dimensions to HW.,vfw_vpx_hw_ifc.c,None,None,This vulnerability is publicly known,None,"APQ8009,APQ8009W,APQ8017,APQ8037,APQ8053,APQ8096,APQ8096AU,APQ8096SG,APQ8098,MDM9640,MSM8108,MSM8208,MSM8209,MSM8608,MSM8909,MSM8909W,MSM8917,MSM8937,MSM8953,MSM8996,MSM8996AU,MSM8996SG,MSM8998,SDA845,SDM845"
1050893,Use of Uninitialized Variable while playing HEVC content using HD DMB ,Multimedia,Video,High,Local,CWE-457 Use of Uninitialized Variable,"While playing HEVC content using HD DMB, an uninitialized variable can be used leading to a kernel fault.",Play HEVC content with errors where the closest picture index in the forward or backward direction is not in the DPB frame.,Reported by a customer,The logic to handle backward reference pictures in HEVC error concealment cases is upgraded,vfw_h265_ref_list.c,None,None,This vulnerability is not publicly known,"APQ8053,APQ8096,APQ8096AU,APQ8096SG,APQ8098,MDM9640,MSM8953,MSM8996,MSM8996AU,MSM8996SG,MSM8998"
1087647,wlan: Some information elements (IEs) in probe request frame affecting user privacy (Applicable to Android O or later) [FW],WConnect,WLAN Embedded SW,High,Adjacent,CWE-200 Information Exposure,"The probe requests originated from user's phone contains the information elements which specifies the supported wifi features. This shall impact the user's privacy if someone sniffs the probe requests originated by this DUT. Hence, control the presence of which information elements is supported.",Turn ON the Wi-Fi and sniff the probe requests for information elements using which supported features can be known.,Publicly known,"IE whitelisting refers to the inclusion of selected IEs in probe request frames.
This change adds sending probe request routines, inspect which IE white listing can be controlled, if enabled, then includes only selective IEs and vendor OUIs specified in the ie bitmap and vendor oui bitmap.
The change requires the framework (Android O or later) to actually set whitelist IEs.
",wlan_batch_scan_offload.c
wlan_dev.c
wlan_extscan_bucket.c
wlan_framegen.c
wlan_framegen.h
wlan_lpi.c
wlan_network_list_offload.c
wlan_rtt.c
wlan_scan.c
wlan_scan.h
wlan_scan_sch.c
wlan_scan_sm.c
wlan_vdev_keepalive.c,None,None,This vulnerability is publicly known,"APQ8009,APQ8017,APQ8053,APQ8076,APQ8096,APQ8096AU,APQ8096SG,MDM9206,MDM9250,MDM9607,MDM9628,MDM9640,MSM8909,MSM8976,MSM8992,MSM8996,MSM8996AU,MSM8996SG,SDX20M"
1099411,wlan: Possible leakage of original sequence numbers and source address of probe request frames affecting user privacy (Applicable to Android O or later) [FW],WConnect,WLAN Embedded SW,High,Adjacent,CWE-330 Use of Insufficiently Random Values,"The original mac spoofing feature does not use the following in probe request frames: (a) randomized sequence numbers and (b) randomized source address for cfg80211 scan, vendor scan and pno scan which may affect user privacy.",Turn ON the Wi-Fi and sniff the probe requests to find out the following:
(a) incremental (non-randomized) sequence numbers and
(b) original MAC address of the device,Publicly known,"Mac randomization refers to the randomization of probe request source address and sequence numbers.
This change implements Mac randomization to randomize probe request's source MAC address and sequence number in host, vendor and pno scans to maintain / improve user's privacy.

The change requires the framework (Android O or later) to actually set this feature",wlan_framegen.c
wlan_framegen.h
wlan_mgmt_local_txrx.c
wlan_mgmt_local_txrx.h
wlan_rtt.c
wlan_rtt.h
wlan_scan.c
wlan_scan_priv.h
wlan_scan_sm.c
wlan_vdev_keepalive.c,None,None,This vulnerability is publicly known,"APQ8009,APQ8017,APQ8053,APQ8076,APQ8096,APQ8096AU,APQ8096SG,MDM9206,MDM9250,MDM9607,MDM9628,MDM9640,MSM8909,MSM8976,MSM8992,MSM8996,MSM8996AU,MSM8996SG,SDX20M"
如果我尝试将此文件与其他文件合并,则会出现以下错误:

Traceback (most recent call last):
  File "QC_SB_AMSS_Copy.py", line 284, in <module>
    dfnew = pd.merge(df, dfold, how='left')
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\pandas\core\reshape\merge.py", line 53, in merge
    copy=copy, indicator=indicator)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\pandas\core\reshape\merge.py", line 562, in __init__
    self._maybe_coerce_merge_keys()
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\pandas\core\reshape\merge.py", line 906, in _maybe_coerce_merge_keys
    **{name: self.left[name].astype(object)})
TypeError: assign() keywords must be strings

熊猫似乎工作得很好,CSV是错误的(至少是这里发布的那个)。最初,文件读取为31项,而只有8项,因为(至少)缺少6个双引号:

  • 报告1087647中的文件列表周围
  • 报告109941中的文件列表周围
  • 关于报告109941的“打开Wi-Fi并嗅探[…](b)设备的原始MAC地址”部分
事实上,你可以在帖子中看到它们:当某个东西用双引号括起来时,它是红色的,而没有引号的是黑色的。只需向下滚动(它们都在块的下半部分)


如果换行符位于双引号字符串中,Pandas会正确地将其解析为一个字符串,如
“line1\nline2\nline3”

是否可以发布一个?在没有看到任何代码的情况下很难猜测。如果有换行符(带换行符),它就不再是CSV了。您可以做的一个简单检查是在Excel中重新导入该内容。(顺便问一下:它是使用Excel的导出功能导出的,还是以自制的方式导出的,例如VBA?@tevemadar“它不再是CSV了”。为什么不呢?在
csv
中转义换行符很有效,可能很笨拙,但这是我见过很多次的事情(而且
csv
没有真正的标准)。建议:您似乎与熊猫一起工作;使用
csv
模块更改分隔符是否有效?您的文件不正确,因为某些包含换行符的字段没有正确引用。在CSV创建时强制引用,当前文件不可用。我使用了excel导出功能,我只使用pandas…@TigerClaw,不幸的是我不知道。将此作为答案发布,因为它对于注释来说太长,而且还需要格式化。我对Excel不太了解,无法找出它为什么或如何破坏导出的某些部分(如果发生这种情况的话),而正确导出了另一半数据,包括多行字段。您当然可以尝试的一件事是,这次手动修复CSV,并查看合并是否开始工作。我使用df_qctocsv.to_CSV(f,sep=',',',header=None,index_label=False,index=False,quotechar='',quoting=CSV.QUOTE-ALL)来解决这个问题
dfold = pd.read_csv(csv_newfile, delimiter=',', header=None, engine='python', usecols=range(0, 23), error_bad_lines=False)
dfnew = pd.merge(df, dfold, how='left')