Hi,
I'm reading from a text file and writing to another one.My problem is that the data is being written to the new file as one line..i.e., when the end of a line is reached it does not start writing a new line but continues on the same line.. Can someone please tell me how to make it write data line by line? this is my code..Any improvements and suggestions will be appreciated. Thanks
Me and a friend have been working on a program over the past couple of days and figured out how to read a file of ints into a program, it worked the first day we made it, but i mustve changed something because now it reads from the second interger on and adds a zero at the end.
heres the code:
#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
#in
This is something that I can't explain at all.
Problem: Use a 2 dimensional static array with 3 rows & 2 columns to the course number and number grade you have received in that course. The program should have three functions called get information, printinformation, and convert. You need to send array to getinformation and printinformation functions as parameters. The get information will ask for course no.
Script files
A shellscript usually resides inside a file. This file can be executable, but you can also call a Bash with that filename as parameter:
bash ./myfile
There is no need to add a boring filename extension like .bash or .sh. This is UNIX(r), where executables are not tagged by the extension, but by permissions (filemode). Of course, you can name the file like you want!
Hi All,
I have a quick question with regards to SED syntax, and I hope someone here can help me out.
I have some text based reports in which I would like to strip the "Current Date" from and replace with equivalent number of empty spaces, for every occurrence.
For example, here is what I need to strip:
Hi All,
I have a quick question with regards to SED syntax, and I hope someone here can help me out.
I have some text based reports in which I would like to strip the "Current Date" from and replace with equivalent number of empty spaces, for every occurrence.
For example, here is what I need to strip:
Given a file myfile with the following contents:
$ cat myfile
foos
A hexdump of the file gives us the contents:
$ hexdump myfile
6f66 736f 000a
Currently, I can create the file by specifying the contents in ascii like this:
$ echo foo > myfile
Is it possible to create the file by giving it the exact bytes in hexadecimal rather than ascii?
$ # How can I make this work?
$ echo --fake-he
Hello all,
I have written sth like this:
Code:
#!/bin/bash
grep -e XXX -e YYYY myfile.log | grep -v ZZZ | awk '{print $1 " " $2 ";" $3 ";" $9 ";" $11}' > myfile.csv
sed -i '1iDate;Time;From;To' myfile.csv
=> it is clear that it converts log to csv and add a header.
Now I want to subtract row B3-B2,B5-B4,...