Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] ignore white space and text

Expand Messages
  • Charles K. Clarkson
    ... To ignore that specific line place this in your processing loop: while { next if /^d/i; # skip if line starts with d or D . . . . } HTH,
    Message 1 of 7 , Feb 1, 2001
    • 0 Attachment
      > From: "Foster, Russell J." <RFoster@...>
      > > Tham,
      > >
      > > When I read in a text file to be parsed, I usually do it like this:
      > >
      > > @x = split (/\t+/,$line);
      > >
      > > This splits the items on the line by anything seperated by one or more
      > tabs.
      > > This allows me to use 1 or more tabs in the text file so that I can line
      > > things up to make them easier to read.
      > >
      > > If you want to ignore the space it front, just throw away the first item
      > of
      > > the split.
      > >
      > > -rjf
      > >
      > >
      > > > From: Tham Huei Hwan [mailto:hhtham@...]
      > > > Subject: [PBML] ignore white space and text
      > > >
      > > >
      > > > Hi all,
      > > >
      > > > How do ignore white space and also text (row and column) of the data
      > > > file ?
      > > >
      > > > I am using "split" function by space on building my hash array form
      > > > this data file.
      > > >
      > > > -- sample --
      > > >
      > > >
      > > > dbnum chksize freesize <--- would like to
      > > > ignore this
      > > > text, how ?
      > > >
      > > > 1 100 10
      > > > 2 400 50
      > > > 3 300 20
      > > > |
      > > > ignore white space in front, how ?
      > > >
      > > >

      To ignore that specific line place this in your
      processing loop:

      while <DATA> {
      next if /^d/i; # skip if line starts with 'd' or 'D'.
      . . .
      }

      HTH,
      Charles K. Clarkson
    Your message has been successfully submitted and would be delivered to recipients shortly.