Recent content by Sam032789
-
S
Editing Text Files - Easiest Way To Merge Every Other Line
Oh, I see. Thanks for the explanation. I was wondering why this was so! Glad everything worked out in the end :)- Sam032789
- Post #14
- Forum: Programming and Computer Science
-
S
Editing Text Files - Easiest Way To Merge Every Other Line
Problem is solved. My problem in the last two files was that I also had \r's and \n's at the end of each line, instead of just the \n for the other 3 files. If anyone is curious, this is the code I used (and it worked perfectly): sed 's/\r//; /^T/ {N; s/\n/ /}' <input.txt >output.txt- Sam032789
- Post #12
- Forum: Programming and Computer Science
-
S
Editing Text Files - Easiest Way To Merge Every Other Line
Yes... but what if the files that look the same are different? This is my problem now. The last two files are different. I had no problem duplicating the commands and changing one character to operate on different files. I thought all the files were the same. Now I know that they are not...- Sam032789
- Post #11
- Forum: Programming and Computer Science
-
S
Editing Text Files - Easiest Way To Merge Every Other Line
I thought they were. They look identical to the files that worked. I had to download the data from a website, and it's quite possible they are different in some way I cannot see for these two months.- Sam032789
- Post #9
- Forum: Programming and Computer Science
-
S
Editing Text Files - Easiest Way To Merge Every Other Line
Hmm. I guess I don't see the point in specifying how many lines. Whether it's 5 or 5 million, the operation in sed is essentially the same.- Sam032789
- Post #7
- Forum: Programming and Computer Science
-
S
Editing Text Files - Easiest Way To Merge Every Other Line
jhae2.718: Yes, that is the desired output. It worked with 3 out of the 5 files... the other ones turned out like this: T,2009,08,18,15,41,28 D,ZBXX,420,3.972e-5,2.358e-5,3.176e-5,1.940e-5,1.304e-5,2.451e-5 T,2009,08,18,15,42,28...- Sam032789
- Post #5
- Forum: Programming and Computer Science
-
S
Editing Text Files - Easiest Way To Merge Every Other Line
Hello! I have a file that looks like this: Where every line beginning with a T is a new data set. So basically I need each line in the file to look like this: I need to merge every other line so that each data set lies on the same line. There can just be a space in between the two...- Sam032789
- Thread
- File Text
- Replies: 14
- Forum: Programming and Computer Science
-
S
Java Java: Fix Error & Read File Args to Variables
Hello, I am just starting to learn Java. I have a small file that needs reading in, line by line, with different arguments. Such a line looks like this: 123 Midterm .25 100 456 TakehomeExam .25 200 0 Quiz03 .10 25 1 Final .40 100 I need to read these in as separate variables. I...- Sam032789
- Thread
- Java
- Replies: 1
- Forum: Programming and Computer Science
-
S
Fortran Fortran 95 Reading in Multi-Dimensional Arrays
I thought I had it, but apparently I cannot figure out how to obtain the high and low temperature values for each day. Anyone have any suggestions?- Sam032789
- Post #5
- Forum: Programming and Computer Science
-
S
Fortran Fortran 95 Reading in Multi-Dimensional Arrays
Nevermind, I figured it out: PROGRAM FileArray implicit none integer :: i, j, lines integer, dimension(6,75) :: a !a(1,*) = year !a(2,*) = month !a(3,*) = day !a(4,*) = hour !a(5,*) = temp !a(6,*) = dew point 100 FORMAT(I4, 5X, I2, 7X, I2, 7X, I4, 5X, I2, 7X, I2)...- Sam032789
- Post #2
- Forum: Programming and Computer Science
-
S
Fortran Fortran 95 Reading in Multi-Dimensional Arrays
Hi. I have a file like this: 1990 01 01 0000 27 16 1990 01 01 0100 25 15 1990 01 01 0200 24 16 1990 01 01 0300 24 16 1990 01 01 0400 22...- Sam032789
- Thread
- Arrays Fortran Reading
- Replies: 4
- Forum: Programming and Computer Science