text-files

Windows Phone 8 choose text file C#

牧云@^-^@ 提交于 2019-12-11 04:27:38
问题 i have a question. If there is a possibility at windows phone 8 at visual studio to create button event to read text file? i know about streamReader and if i declare wchich exacly file i want to read, but if i want to choose from list of files wchich i want to display. i did research on the Internet but i didint find an answer. I know i can use isolatedStorage to read music, video, image but not text files, on the app i created few files with text in it and i want users to have posibility to

Opening text files from a list within another text file using python

不羁岁月 提交于 2019-12-11 04:24:04
问题 I'm probably doing something very silly and basic, but I just can't get this bit of code to work. I have a text file that contains a list of more text files (log files) with the full path for them. I want to open the first file, grab the list and then open each in turn (ultimately to do a search within each for errors) and then close them. The problem I am having is that I can't get the data from the newly opened secondary files to display. Text file 1 (logs.txt) : //server-1/program/data

How to edit a text file in c# with StreamWriter?

青春壹個敷衍的年華 提交于 2019-12-11 04:03:37
问题 I have a method to edit a word from a text file file and display it on the command prompt. Now I an trying to make a method to edit a word from a text file and write it to a new file. I would also like to mention that I cannot use the File or Regex class since I am not allowed to use it for my assignment. Here is my code for the StreamReader: public void EditorialControl(string fileName, string word, string replacement) { List<string> list = new List<string>(); using (StreamReader reader =

Reading a .tps morphometrics file into R

為{幸葍}努か 提交于 2019-12-11 04:02:20
问题 I am looking to read a .tps file into R. An example file is now available at: example file The actual files I am trying to read into R obviously have many more individuals/IDs (>1000) The .tps file format is produced by TPSDIG. http://life.bio.sunysb.edu/morph/ The file is an ANSI plain text file. The file contains X and Y coordinates and specimen information as follows. The main difficulty is that specimens vary in the numbers of attributes (eg. some have 4 and some have 6 LM landmarks, some

Replace multiple text in a text file using vbscript

霸气de小男生 提交于 2019-12-11 03:45:47
问题 I am trying to replace 3 text from a text file.I tried this- Const ForReading = 1 Const ForWriting = 2 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("W:\Test.txt", ForReading) strText = objFile.ReadAll objFile.Close strNewText = Replace(strText, "Aron_", "Lori_") strNewText1 = Replace(strText, "Aron", "Jason") 'Not working strNewText2 = Replace(strText, "Sketa", "Skicia") 'Not working Set objFile = objFSO.OpenTextFile("W:\Test.txt", ForWriting)

how to update certain parts of text file in java

走远了吗. 提交于 2019-12-11 03:19:38
问题 I want to be able to update a certain line on a text file. But I get the error that it cannot delete the file, why do I get this error? public class Main { public static void main(String[] args) { Main rlf = new Main(); rlf.removeLineFromFile("F:\\text.txt", "bbb"); } public void removeLineFromFile(String file, String lineToRemove) { try { File inFile = new File(file); if (!inFile.isFile()) { System.out.println("Parameter is not an existing file"); return; } //Construct the new file that will

fscanf() only picking up first line of file

▼魔方 西西 提交于 2019-12-11 03:17:38
问题 I have a tab delimited file that I am trying to convert to a tab delimited file. I am using C. I am getting stuck on trying to read the second line of the file. Now I just have an tens of thousand of lines repeating the first line. #include <stdio.h> #include <string.h> #define SELLERCODE A2LQ9QFN82X636 int main () { typedef char* string; FILE* stream; FILE* output; string asin[200]; string sku[15]; string fnsku[15]; int quality = 0; stream = fopen("c:\\out\\a.txt", "r"); output = fopen("c:\

How to read from a file using C# code?

旧街凉风 提交于 2019-12-11 03:09:51
问题 I have a file contains two lines . and in which line there is a double parameter . I want to read both lines from the file and save them in an array of doubles . I used the C# code below , but It doesn't work . It doesn't read anything and the array is empty after running the code . Anybody has any idea where did I do wrong ? Thanks for help . private FileStream input; double[] arr; int i = 1; input = new FileStream(Application.StartupPath+"\\City.txt", FileMode.Open, FileAccess.Read);

How can you pick one line from a text file and transform it into an array object?

一笑奈何 提交于 2019-12-11 02:45:09
问题 Okay this is code and I need to somehow take a line from the textfile and transform into an array object. like p[0] = "asdasdasd" public class Patient2 { public static void main(String args[]) { int field = 0; String repeat = "n"; String repeat1 = "y"; Scanner keyIn = new Scanner(System.in); // FILE I/O try{ // Open the file that is the first // command line parameter FileInputStream fstream = new FileInputStream("Patient.txt"); BufferedReader br = new BufferedReader(new InputStreamReader

VBA Excel Save Copy as txt File

こ雲淡風輕ζ 提交于 2019-12-11 01:49:20
问题 Is it possible to save a copy of a workbook as txt file? I tried ThisWorkbook.SaveCopyAs("wb.txt") . However this saves the excel with txt without any file conversion. So when I open the text file no data is displayed. 回答1: Another way ThisFile = "Filename" code..... ActiveWorkbook.SaveAs Filename:="\folderlocation\" & ThisFile & ".txt", FileFormat:=xlText 回答2: Application.DisplayAlerts = False Dim s As String s = ActiveWorkbook.FullName s = Replace(s, "xlsx", "txt") ActiveWorkbook.SaveAs