Excel到CSV与UTF8编码(Excel to CSV with UTF8 encoding)
我有一个Excel文件,有一些西班牙文字符(波浪号等),我需要转换为CSV文件用作导入文件。 但是,当我另存为CSV时,可以将“特殊”的西班牙字符转换为ASCII字符。 它似乎也是这样做的左右引号和长破折号似乎来自原始用户在Mac中创建Excel文件。
由于CSV只是一个文本文件,我相信它可以处理一个UTF8编码,所以我猜这是一个Excel限制,但我正在寻找一种从Excel到CSV的方式,并保留非ASCII字符完整。
I have an Excel file that has some Spanish characters (tildes, etc.) that I need to convert to a CSV file to use as an import file. However, when I do Save As CSV it mangles the "special" Spanish characters that aren't ASCII characters. It also seems to do this with the left and right quotes and long dashes that appear to be coming from the original user creating the Excel file in Mac.
Since CSV is just a text file I'm sure it can handle a UTF8 encoding, so I'm guessing it is an Excel limitation, but I'm looking for a way to get from Excel to CSV and keep the non-ASCII characters intact.
原文:https://stackoverflow.com/questions/4221176
最满意答案
您缺少
orderByKey()
。 对于任何过滤查询,您必须使用排序功能。 请参阅文档在你的
onRefresh
方法中,你需要设置限制:public void onRefresh() { // Refresh items ///HERE "oldestPostId" IS THE KEY WHICH I GET THE LAST RECORDS FROM THE FIREBASE mChatRef.orderByKey().startAt(oldestPostId).limitToFirst(10).addListenerForSingleValueEvent(new ValueEventListener() { .....
因此,在您获得前10条记录后,您检索的数据是仅有的10条新记录。
确保保存新检索数据的最旧密钥,以便在下一次刷新时仅检索此密钥的新数据。
建议:您可以使用值侦听器并获取大小的最后一个数据快照以获取最后一条记录的密钥,而不是添加子值侦听器来查找最后一个密钥。
You are missing
orderByKey()
. For any filtering queries you must use the ordering functions. Refer to the documentationIn your
onRefresh
method you need to set the limit:public void onRefresh() { // Refresh items ///HERE "oldestPostId" IS THE KEY WHICH I GET THE LAST RECORDS FROM THE FIREBASE mChatRef.orderByKey().startAt(oldestPostId).limitToFirst(10).addListenerForSingleValueEvent(new ValueEventListener() { .....
So the data you retrieve is the only 10 new records after you got your first 10 records.
Make sure to save the oldest key of the newly retrieved data so that on next refresh new data from this key is only retrieved.
Suggestion: Instead of adding a child value listener to find the last key, you can just use the value listener and get the last data snapshot with the size to get the last record's key.
相关问答
更多-
您缺少orderByKey() 。 对于任何过滤查询,您必须使用排序功能。 请参阅文档 在你的onRefresh方法中,你需要设置限制: public void onRefresh() { // Refresh items ///HERE "oldestPostId" IS THE KEY WHICH I GET THE LAST RECORDS FROM THE FIREBASE mChatRef.orderByKey().startAt(olde ...
-
ios 6拉动刷新(ios 6 pull to refresh)[2021-12-01]
像[self handleRefresh:nil] Something like [self handleRefresh:nil] -
Firebase Pull通知(Firebase Pull notification)[2023-04-06]
如果应用程序已关闭(不在后台),则会在收到通知时调用onMessageReceived方法,并且您可以使用remoteMessage.getData().get("key_for_parameter");检索数据有效内容remoteMessage.getData().get("key_for_parameter"); 其中key_for_parameter是您在通知中发送的参数的名称。 即使应用程序已关闭,也会调用此方法。 但是,请考虑只有在通知中省略“通知”参数时才调用“onMessageReceived ... -
来自firebase的数据未在路由更改时加载,但在刷新时进行(Data from firebase not loading on route change, but does on refresh)[2023-02-19]
没有理由使用像$ firebase(负责同步等)的包装器lib下载数据,然后立即将数据拉出并将其放入不同的范围对象中。 只需声明你的范围var: $scope.products = $firebase(ref); 并使用它:- {{product|json}}
-
WatchKit拉动刷新(WatchKit pull to refresh)[2021-12-04]
不幸的是,目前还不可能。 与其他WatchKit类一样,WKInterfaceTable在监视状态方面没有提供太多功能。 无法监控滚动位置。 您目前可以做的最好的事情是在UI中添加一个按钮,以启动数据刷新或使用强制触摸菜单。 Unfortunately it isn't possible at this time. WKInterfaceTable, like other WatchKit classes, doesn't offer much in the way of monitoring state. ... -
似乎在Firebase闭包之外调用了self.refresh.endRefreshing()。 这很糟糕,因为代码将在Firebase返回数据并重新加载tableView数据之前运行。 请记住,Firebase是异步的,因特网需要时间将Firebase服务器上的数据传输到您的应用程序,因此内联代码通常会在关闭代码之前执行。 此外,在这种情况下不需要Handle,除非您在其他地方使用它。 Ref?.child("Posts").queryOrdered(byChild: "Des").queryEqual(t ...
-
好的,所以这里有几个问题,首先是让应用程序在查询数据库之前等待。 要做到这一点,我建议暂停线程几秒钟,同时使用处理程序加载数据。 handler1.postDelayed(new Runnable() { @Override public void run() { // Your Database Reference Listener } }, 1000); 还要只从firebase中听一些只是改变听众的方式 yourDatabaseReferance. ...
-
解 您可以使用scrollOffset属性和carouselDidScroll方法来实现“Pull to Refresh”和“Load More”功能。 @property (nonatomic, assign) CGFloat scrollOffset; 这是轮播的当前滚动偏移量,以itemWidth的倍数表示。 该值四舍五入到最接近的整数,是currentItemIndex值。 您可以使用此值在旋转木马运动时定位其他屏幕元素。 如果您希望以编程方式将轮播滚动到特定偏移量,也可以设置该值。 如果您希望禁用 ...
-
onAuthStateChanged事件可能会多次触发。 每次都有,你会在显示器上添加更多人。 要解决此问题,请确保只使用查询中的人员: ref.once("value", function(snapshot){ var people = []; snapshot.forEach(function(data){ people.push(data.val()); }); this.setState({ people: people }) ...
-
我建议你还在Model类中添加另一个变量。 像“id”之类的东西。 并在其中存储随机Long值。 (例如从0到15)。 然后创建一个生成随机值的方法(假设方法的名称为generateRandom() )。 这样,当您想要获取随机数据时,您可以使用以下查询: query = mDatabase.orderByChild("id").startAt(generateRandom()).limitToFirst(6); I suggest you also add another variable to yo ...