in reply to Ignore newlines within quotes while reading a line in a text file

Use Text::CSV to read the files. It is what is was designed for.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re: Ignore newlines within quotes while reading a line in a text file

Replies are listed 'Best First'.
Re^2: Ignore newlines within quotes while reading a line in a text file
by jab43 (Initiate) on Aug 09, 2013 at 20:42 UTC

    I looked into that module but I am limited to using the basic Perl installation so I cannot use that module.

      Good luck copying the source of the module into your programme, then.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

        An alternative might be to try to use the code of one of the Excel modules and to read directly from the spreadsheet. Some of them at least seem to be pure Perl, so that incorporating their code into your program or installing manually the *.pm into your default directory might be easier. I did it once about 3 years ago in an environment where I could not install the module with the standard procedures, it took me a couple of hours to resolve the various dependencies, but it worked. BTW, it was in a AIX environment, so not the easiest to use Excel file (OLE not available, etc.).

        But is also depends on which version of Excel we are talking about.

      I looked into that module but I am limited to using the basic Perl installation so I cannot use that module.

      Then that is the real problem you should be resolving! You don't even need to be system administrator, you can install modules as a regular user.

        The reason I can't include any other modules is because the computer my script will be running on only includes the basic Perl modules and other the bosses don't want to install other modules. So I'm left with a headache.

        Is there a regex I could use to find newlines within quotes?