简体   繁体   English

格式化 Excel.iqy Web 查询的结果

[英]Formatting Results of Excel .iqy Web Query

I need to format the results of a web query.iqy file in Excel.我需要在 Excel 中格式化 Web query.iqy 文件的结果。

Here's what the.iqy file looks like:下面是 .iqy 文件的样子:

WEB
1
http://www.mdl.nws.noaa.gov/~BMA-SREF/data/text/sref_2-M_TMP_["CURRDATE","Click cell where (YYYYMMDD) is"]03.txt
Selection=All
Formatting=None
PreFormattedTextToColumns=False
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False

Right now, all the results are going into Column A, even though there are 5+ columns in the actual text file.现在,所有结果都进入 A 列,即使实际文本文件中有 5 列以上。 I need the results to be delimited in the worksheet after the web query is completed. Web 查询完成后,我需要在工作表中分隔结果。

Set PreFormattedTextToColumns=True 设置PreFormattedTextToColumns = True

That should do it. 那应该做。

By default, Excel has trouble understanding how to handle files with delimited data for some reason, and it's not a problem with the.iqy file.默认情况下,Excel 出于某种原因无法理解如何处理带有分隔数据的文件,而 .iqy 文件不是问题。

If you have control over the source of the file, the closest thing to a solution is to prepend sep=<delimiter> to the data so that it looks like this (assuming comma-delimited data):如果您可以控制文件的来源,那么最接近解决方案的方法是将sep=<delimiter>添加到数据之前,使其看起来像这样(假设以逗号分隔的数据):

sep=,
a,b,c
1,2,3

Ref: https://superuser.com/questions/407082/easiest-way-to-open-csv-with-commas-in-excel/730509#730509参考: https ://superuser.com/questions/407082/easiest-way-to-open-csv-with-commas-in-excel/730509#730509

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM