如何排序字符串列表 [英] How can I sort a string list

查看:89
本文介绍了如何排序字符串列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个代码模块,在写入提取文件之前公开提取文件数据。输入数组的每个成员代表一行文本,通常将其写入提取文件。

提取文件为CSV格式,包含字段(BankID,DDA,DepositDate,TotalAmount,TotalChecks)。我无法访问后端SQL或sln。如何在将BankID发送到提取文件之前按BankID排序?



考虑以这种格式转储的数据:

I have a code module that exposes the extract file data prior to being written to the extract file. Each member of the input array represents a line of text that will normally be written to the extract file.
The extract file is in CSV format with fields (BankID, DDA, DepositDate,TotalAmount,TotalChecks). I don't have access to backend SQL nor the sln. How can I sort by BankID before sending it to extract file?

Consider the data being dumped in this format:

BankID ,               DDA, DepositDate,  TotalAmount, TotalChecks
    224152,        5800956996,  11/04/2013,   $15,969.32,          10
    4522424,        5800956996,  11/04/2013,   $26,303.26,          21
    415224,        5800956996,  11/04/2013,        $0.00,           0
    985758,        5800956996,  11/04/2013,   $91,172.66,           8
    11124,        5800956996,  11/04/2013,   $37,395.50,           7







public class PostProcessing {

        public object ProcessExtract(List<string> FileRows) {

            List<string> arRetVal = new List<string>();

            // Loop through each row of text of the extract file and modify
            // as necessary
            foreach(string rowText in FileRows) {
                arRetVal.Add(rowText);
            }

            return(arRetVal);
        }

推荐答案

15, 969 32 10
4522424 5800956996 ,11/04/2013,
15,969.32, 10 4522424, 5800956996, 11/04/2013,


26, 303 。< span class =code-digit> 26 , 21
415224 5800956996 ,11/04/2013,
26,303.26, 21 415224, 5800956996, 11/04/2013,


0. 00 0
985758 5800956996 ,11/04/2013,
0.00, 0 985758, 5800956996, 11/04/2013,


这篇关于如何排序字符串列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆