Re^5: converting txt to csv and formattingby Jim (Curate)
|on Jul 06, 2014 at 02:47 UTC||Need Help??|
This would be assuming that I can modify the text file?
Uh… no. What makes you think that?
This is just a snippet of the code you'd use within your line-reading while loop.
BTW, you could do the chomping in the same for loop as the rest of the formatting.
Update: Maybe you were confused by my use of an array variable instead of three scalar variables. Let's assume you've read three lines (i.e., three client data values) into three variables as AppleFritter demonstrated here, but without chomping them as you read them.
Another update: It occurs to me now that if you're new to Perl, then you're probably not familiar with the fancy regular expression pattern in this global substitution operation:
It's a look-ahead assertion, which is sort of an intermediate Perl topic. (See perldoc perlre.) If it's easier to understand, then just do this instead: