主要想记录一下 . 写NSString 到txt . 数组的去重 . 数组的截取 . 数组分割 代码如下: NSString *year = @"2018"; NSArray *momth = @[@"05",@"06",@"07",@"08",@"09",@"10",@"11",@"12"]; NSArray *day = @…
import java.io.*; /** * Created by czz on 2019/9/23. */ public class TTest { /** * 生成大量插入语句,并将语句写入txt文件中 * 本例为生成一千条以上的ip地址数据插入数据库 * @param args * @throws Exception */ public static void main(String[] args) throws Exception{ String filename = "c:"…
将字符串写入C盘txt文件里 File.AppendAllText(@"C:\" + DateTime.Now.ToString("HHmmss") + ".txt","Hello World!");…
function writelog($str) { $open=fopen("e:\log.txt","a" ); fwrite($open,$str); fclose($open); } 1. 使用 fopen($filePath, $type)  来打开文件, $filePah--保存文件的路径:$type--打开文件的方式,更多fopen()的信息http://www.w3school.com.cn/php/func_filesystem_fopen.asp…
一.Lrc歌词去时间轴转Txt文件 环境:Python2.7.x, Mac(Windows需装cygwin环境,当然你也可以自己改代码,Python新手,勿喷) # -*- coding: UTF-8 -*- import re import sys import os,shutil reload(sys) sys.setdefaultencoding("utf-8") rootdir = os.getcwd() def delfile(str): if os.path.exists(…
控制台程序,将一系列有用的格言写入到文件中. 本例使用通道把不同长度的字符串写入到文件中,为了方便从文件中恢复字符串,将每个字符串的长度写入到文件中紧靠字符串本身前面的位置,这可以告知在读取字符串之前字符串中存在的字符数目,也可以使用视图缓冲区来读取字符串. import static java.nio.file.StandardOpenOption.*; import java.nio.file.*; import java.nio.channels.*; import java.util.E…
在数据库时候我设计了学生的分数为nvarchar(50),是为了在从TXT文件中读取数据插入到数据库表时候方便,但是在后期由于涉及到统计问题,比如求平均值等,需要int类型才可以,方法是:Convert(int,字段名).例如:select avg(Convert(int,M_Score)) from temp 建立视图,将视图当表示用 CREATE VIEW temp AS select StudentId, MAX(StudentScore) as M_Score from T_Studen…
/********************** 保存接收按钮 *****************************/ private void SavetxData_Click(object sender, EventArgs e) { SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "(*.txt)|*.txt|(*.*)|*.*"; saveFileDialog.Fil…
思路:先判断是否为文件,如果是文件,则需要判断改文件名是否包含字符串"txt",包含则输出.如果是文件夹的话,先需要判断文件名是否包含".txt"(因为文件名也可能包含txt),然后再用递归方法遍历子文件. 代码:方法 public static void SearchAtString(File file,String str) { if(file.isFile()) { if((file.getName().indexOf(str))!=-1) { System.…
[m, n] = size(FFoutpu);fp = fopen('FFoutpu.txt','wt');fprintf(fp, 'name CODE ROTC EBIT_EV SHIZHI ROTC_ID EBIT_EV_ID ID_PLUS INCREASE \r\n');for i=1:m fprintf(fp, '%s\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t\r', ... StockNameMap(FFoutpu(i, CODE)), ... FFoutp…