in reply to EMPTY OUTPUT FILE GENERATED
NEVER, NEVER EVER use a tab delimited file yourself - this is nasty stuff!
If you have fixed space fonts for this, then you cannot tell by just looking at this whether this is just spaces or even if there is a tab character in these lines!
When confronted with a tab delimted file, I would think about s/\t/|/g; or the tr equivalent! The '|' character is is just a FAR, FAR better field delimiter than a tab. Many Databases are done this way. Second choice would be a CSV format. A tab delimited file just has all things bad going for it - sorry if you have to deal with one of these things. Don't make one yourself!123 aBVXC SAOMEWTRINOGN ABC 876 AsrdaDS some_bs 564 37897654 aofruafdouf abc <c> <c> #!/usr/bin/perl -w use strict; open (IN, '<', "tab_file.txt") or die "$!"; while (<IN>) { my ($first_token) = split (/\s/, $_); #should be(/\t/, $_) print $first_token,"\n"; } __END__ 123 876 37897654 tab_file.txt: (not really tabs)... 123 aBVXC SAOMEWTRINOGN ABC 876 AsrdaDS some_bs 564 37897654 aofruafdouf abc
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: EMPTY OUTPUT FILE GENERATED
by tobyink (Canon) on Sep 26, 2012 at 12:31 UTC | |
by Marshall (Canon) on Sep 28, 2012 at 05:49 UTC | |
by tobyink (Canon) on Sep 28, 2012 at 07:06 UTC | |
by Marshall (Canon) on Sep 28, 2012 at 16:49 UTC |