text-files

Reading .txt data to Matlab

梦想的初衷 提交于 2019-12-25 03:46:07
问题 I am trying to read data from this .txt: obiekt.DEF Timeplot Column01: P abs h01 L1 [W] Column02: P abs h01 L2 [W] Column03: P abs h01 L3 [W] Column04: P abs h01 Sum [W] Time Column01 Column02 Column03 Column04 11.03.2004 09:17:02 23500 19812 21529 64,84e+3 11.03.2004 09:17:05 23316 19789 21519 64,62e+3 11.03.2004 09:17:08 23207 19759 21392 64,36e+3 I only need data from column: 01,02,03. Some data have ',' instead '.'. How to change it? I have many file like this. I tried this function, but

Set variable equal to a number in a text file Batch

回眸只為那壹抹淺笑 提交于 2019-12-25 01:49:38
问题 I have a batch file ( tickets.bat ) and each time you create a different ticket, by setting multiple variables and echoing the variables to a text file, I want the ticket number to go up by 1. I tried to do this by creating a number.txt file and each time you go through the loop and create a new ticket, it sets %pnumber% to the text file, and then sets %number% to %pnumber% plus 1. But %pnumber% keeps setting to 0, even when the number.txt file contains the number 1 and doesn't change. This

load text file list into <option> tags

半腔热情 提交于 2019-12-25 01:47:22
问题 Im working on a PHP project that involves selecting a song, hitting the submit button and then having the PHP loading the song player to the correct option. For the song selection I want to load these options from a txt file with the following formatting: <br /> <code>All For Love <br /> Break Free <br />Come to the River <br />For You Nam </code> Which I want to be processed to end up like this: <br /> <code> < option value="All For Love"> All For Love< /option> <br /> < option value="Break

Writing multiple lines to a textfile by taking input in python?

老子叫甜甜 提交于 2019-12-25 01:42:45
问题 Iam trying to write a python script that will let me write C code directly to a textfile and change its extension to ".c" without me creating one manually. This is what i did so far.. import time as t from os import path def create_C(dest): date=t.localtime(t.time()) #getting current system date name=raw_input("Enter file name:")+"%d_%d_%d"%(date[0],date[1],date[2])+".c" #User enters the filename if not(path.isfile(dest+name)): #checks if the file already exists f=open(dest+name,"w") f.write

Trying to write a c# program that parses a text file that contains data seperated by headers in square brackets

这一生的挚爱 提交于 2019-12-25 00:52:44
问题 Im writting a program that parses a specific text file that has data in it that im going to prcess later. Each part is seperated by a header in square brackets i was wondering how i could put each segment into an array using the header as a name for the array. Below is an example of the begining of the text file. ive set up a form that lets you choose a file you want to process and ive also set up a way of processing it line by line using objReader.ReadLine in a loop [Params] Version=106

How I can randomize the content of a text file?

与世无争的帅哥 提交于 2019-12-25 00:19:10
问题 I need to randomize ALL the lines inside a text file and then save the unsorted lines by replacing the same text file. How I can do all that? 回答1: Another take on it: Imports System.IO Module Module1 Sub CreateFile(destFile As String) Using sw = New StreamWriter(destFile) For i = 1 To 200 sw.WriteLine("Line " & i.ToString) Next End Using End Sub Function RandomList(nNumbers As Integer) As List(Of Integer) ' generate a List of numbers from 0..nNumbers-1 in a random order. Dim ns As New List(Of

Ada Array store unbounded String getting from .txt file

怎甘沉沦 提交于 2019-12-24 21:49:01
问题 Im having a trouble storing unbounded string to an array if I'mm getting it to .txt file. Here is my hardcoded data: Data : An_Array := (1 => (Name => +"9 - Joe"), 2 => (Name => +"8 - Trisha "), 3 => (Name => +"7 - RR "), 4 => (Name => +"6 - Jane "), 5 => (Name => +"5 - Doe ")); What if I want to get the data from a .txt file? with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_IO; use Ada.Text_IO; with Ada.Containers.Generic_Array_Sort; procedure Main is function "+" (S :

Parse a file with multiple common delimiters C

只愿长相守 提交于 2019-12-24 21:27:52
问题 I'm working on a basic command line music library in C that lets you open a file via command line, and add information like an artist, song title, and year published. Once it exits, it then writes that information back into the same file. The problem I'm having is trying to find a solution to correctly parse the text file. For example, the input file will look something like this: Title: Heirloom, Artist: Basenji, Year Published: 2014 Title: With Me, Artist: Cashmere Cat, Year Published: 2014

How to fix this code written in C?

萝らか妹 提交于 2019-12-24 20:07:19
问题 It works perfectly well for a 20-20 table but for anything else it crashes. the file is in this link:http://www.csd.uoc.gr/~hy100/glid.txt. I can not figure out what the problem is because when I put an 20-20 table it works and when I give a 21-20 table it does the job perfectly fine but crashes before being able to return 0; . #include <stdio.h> #include <stdlib.h> int height, length; char **world, **new_world; int load_world_from_file(char filename[]) { int i, j; char ch; FILE *fp; fp =

Swift. How to append text line to top of file.txt?

天大地大妈咪最大 提交于 2019-12-24 19:15:45
问题 I am implementing a small logger, in which I am writing to a TXT file. I wanted the last event to be at the top of the file but I'm having trouble getting this to work. All examples on the internet are using "fileHandle.seekToEndOfFile()" to write at the end of the file. This is what I have: private static func writeToFile(text: String) { guard let path = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first else { return } guard let writePath = NSURL