Page 1 of 1

files without newline's?

PostPosted: 12 Feb 2011, 17:44
by slapshot5
Hi all,

Going through some files, I ran across a few that have no newline character at the end of lines.

Take Blood Tyrant for example. It has a carriage return at the end of lines, but no newline.

The couple I spot checked were checked in by Sloth for lazylockie in r6318 and r6319. Can anyone shed light on the exact creation source of these files? In the eyes of *nix, these are not valid txt files for us. And it causes the SetInfo script to go infinitely loopy.

-slapshot5

Re: files without newline's?

PostPosted: 12 Feb 2011, 17:45
by slapshot5
I should mention that it's not all files in those checkins. Banshee's Blade is fine for example.

Re: files without newline's?

PostPosted: 12 Feb 2011, 18:56
by Jaedayr
setInfoScript has locked up on me twice in the last couple days. I am running WinXP and my normal process is to sync with SVN, run setinfoScript and then start testing or creating cards. Today it started, processed Axelrod Gunnarson and locked up. It appears to me that Beacon Behemoth does not have any LF, just CR. Will that cause the script to hang? If so, what is the best way to fix the files?

Re: files without newline's?

PostPosted: 12 Feb 2011, 19:01
by slapshot5
I'm not sure the best way to find all the affected files, but the best way to fix the is probably a sed command in a shell script.

I never really knew how to use sed. Just enough to be dangerous.

Re: files without newline's?

PostPosted: 12 Feb 2011, 19:13
by MageKing17
Just write a script to replace CR with LF.

Re: files without newline's?

PostPosted: 12 Feb 2011, 21:47
by slapshot5
Ok, this seems to be working for me on Mac OS X:
Code: Select all
sed -i -e 's/^M/\'$'\n/g' blood_tyrant.txt
note: the "^M" is types as Ctrl+V,M (still holding Ctrl for the M).

Now, it's a matter of finding all affected files and doing this.

-slapshot5

Re: files without newline's?

PostPosted: 12 Feb 2011, 21:57
by slapshot5
Ok. I've got things cleaned up. It was only a couple files. SetInfo script should work again.

-slapshot5

Re: files without newline's?

PostPosted: 14 Feb 2011, 04:16
by Jaedayr
setInfoScript under WinXP is going into infinite loop still. Should all txt files have CR LF at the end of each line? It looks like Sharding Sphinx, Resounding Thunder have and Resounding Scream have LF only. There may be others but I stopped after I found these.

Re: files without newline's?

PostPosted: 14 Feb 2011, 04:22
by slapshot5
LF yes, CR, not necessarily.

Re: files without newline's?

PostPosted: 14 Feb 2011, 04:52
by friarsol
slapshot5 wrote:LF yes, CR, not necessarily.
I think the files that have lines that end with just a Carriage Return without a Newline are the ones that cause problems. Have we figured out what the program is that's causing this problem?

Re: files without newline's?

PostPosted: 14 Feb 2011, 06:03
by slapshot5
friarsol wrote:Have we figured out what the program is that's causing this problem?
Not yet to my knowledge.

-slapshot5