On Saturday 12 March 2005 19:55, Maura Edelweiss Monville wrote:
Other question: HOW can I tell PERL to sckip the initial blanks (spaces) ? I'm extracting some fields from a huge ascii file. all records start with 1 space preceding the fisrt numerical value. Fileds are separated by spaces. This situation seems to confuse the PERL buil-in function split. In fact the extracted fileds are messed up .. misaligned. But if I get rid of the head space (blank character) for any record in the file in advance of starting my PERL program .. then it works ! I just wonder if I can avoid this file pre-processing and do everything by PERL ...
Try this (asciitest looks like this
" field1 field2 field3 field4 field5 field6 field7 field8 field9");
#!/usr/bin/perl -w
#
open "TEXT", "