修改前:
col1,col2,col3,col4
text1,text2,text3,text4
text5,text6,text7,text8
text9,text10,text11,text12
 
修改后:
col1,col2,col3,col4
text1,text2,append\text3,text4
text5,text6,append\text7,text8
text9,text10,append\text11,text12
 
Import-Csv "C:\Users\814072\Desktop\a.csv" | foreach-object {
$_.col3 = 'append\' +$_.col3
$_ #一直不明白这行啥意思,其实看看下面的代码就清楚了,上面那行仅仅将新的col3的值存储在了内存中
} | Export-Csv "C:\Users\814072\Desktop\a2.csv"
 
Import-Csv -Path "C:\Users\814072\Desktop\a.csv" | foreach {
$_
}
输出:
col1                        col2                        col3                        col4                      
----                        ----                        ----                        ----                      
text1                       text2                       text3                       text4
text5                       text6                       text7                       text8
text9                       text10                      text11                      text12
 
Import-Csv -Path "C:\Users\814072\Desktop\a.csv" | foreach {
$_.col3 = "append\" + $_.col3
}
输出:

修改CSV中的某些值 -- 1的更多相关文章

  1. 修改CSV中的某些值 -- 2

    C:\aaa.csv "IPAddress","FullDomainName","RequestedTargetGroupName" &qu ...

  2. 修改CSV中的某些值

    file.csv文件如下,然后对其中某些值进行变换操作,刚学Powershell的时候操作起来很麻烦,现在看来其实就是对于哈希表的操作. col1,col2,col3,col4 text1,text2 ...

  3. 不修改模板的前提下修改VisualState中的某些值

    原文链接:不修改模板的前提下修改VisualState中的某些值 - 超威蓝火 UWP里有一件非常令人不爽的事,大部分控件只提供了Normal状态下的Background,Foreground,Bor ...

  4. js修改table中Td的值(定义td的单击事件)

    /* 页面装载时,为每个td增加单击事件,这样,就可以不用对每个页面进行更改. 添加单击事件属性.此处不可使用setAttribute方法. */ onclick=AddObjOfText; 单击事件 ...

  5. Python 类中__init__()方法中的形参与如何修改类中属性的值

    一.__init__()方法 如果__init__()方法为 class Cat(): def __init__(self,num) : self.num=num Python中类的__init__( ...

  6. Numpy修改数组中的元素值

    import numpy as np x = np.arange(8) # [0 1 2 3 4 5 6 7] # 在数组尾部追加一个元素 np.append(x,10) # array([ 0, 1 ...

  7. C# 如何批量修改集合元素的属性值?

    我们往往会遇到要批量修改集合中元素的值,最笨的办法就是foreach循环,但本文介绍几种优雅的方法. 首先,我们准备好元素类和初始集合: 下面就是几种方法,目前并没有对性能做进一步的测试,有兴趣的童鞋 ...

  8. Linux(CentOS 7)修改max open files的值

    新安装的linux系统允许每个程序的最大打开文件数默认是1024,可以通过ulimit -n命令来查看,查看全部限制,则可以使用命令ulimit -a [root@test ~]# ulimit -a ...

  9. vue中直接修改props中的值并未给出警告,为啥?

    问:vue中直接修改props中的值并未给出警告,为啥? 答:如果props传入的值是引用类型,在子组件中改变其元素,不改变引用,那么不报错: 如果是基本类型,那么在修改时浏览器控制台会有报错信息. ...

随机推荐

  1. Java for LeetCode 079 Word Search

    Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from l ...

  2. 【JAVA、C++】LeetCode 022 Generate Parentheses

    Given n pairs of parentheses, write a function to generate all combinations of well-formed parenthes ...

  3. 【JAVA、C++】LeetCode 019 Remove Nth Node From End of List

    Given a linked list, remove the nth node from the end of list and return its head. For example, Give ...

  4. codeforces A. K-Periodic Array 解题报告

    题目链接:http://codeforces.com/problemset/problem/371/A 题目意思:给出n和k和一个只有1或者2组成的序列,需要求出最少的改变次数,使得 n/k 组里面的 ...

  5. 【好用的小技巧】win8兼容、网页不让复制

    1.今天下了个matlab7,我用的是win8系统,不兼容. 解决:鼠标右键matlab7的快捷键,点击属性,选择兼容性,选择window vista即可运行 2.在一个 网页上看到一个对自己很有帮助 ...

  6. [MACOS] Mac上的抓包工具Charles

    转载自: http://blog.csdn.net/jiangwei0910410003/article/details/41620363 今天就来看一下Mac上如何进行抓包,之前有一篇文章介绍了使用 ...

  7. [Git] Git 文件归档, include submodule

      git archive命令,可以对任意提交对应的目录树建立归档. $ git archive -o latest.zip HEAD  基于最新提交建立归档文件latest.zip $ git ar ...

  8. C++里的静态成员函数不能用const的原因

    From http://blog.csdn.net/freeboy1015/article/details/7634950     static在c++中的第五种含义:用static修饰不访问非静态数 ...

  9. Linux 内核中断内幕

    转自:http://www.ibm.com/developerworks/cn/linux/l-cn-linuxkernelint/index.html#resources Linux 内核中断内幕 ...

  10. codeigniter 对数据库的常用操作

    codeigniter (CI)是一个优秀.敏捷的PHP开源框架,尤其封装了对数据库的操作,很方便,以下是php ci常用的数据库操作,作个记录: /* ======================= ...