in reply to Re^2: Parse file, split
in thread Parse file, split

> This came from the name of the folder (each of these are a folder name containing images of that car) that I parsed into a text file.

Please! Just change the delimiter when writing to something impossible in filenames, like "\t" (hopefully) and your problems when reading are all gone!

In comparison all other approaches are just insane hacks!

Or just avoid any intermediate files.

Cheers Rolf

( addicted to the Perl Programming Language)

Replies are listed 'Best First'.
Re^4: Parse file, split
by mewoq (Initiate) on May 28, 2013 at 01:48 UTC

    Yeah, field limits did the trick

    split(/\t/, $_, 3) worked out.

    What I want to do now is, I have a text file that lists the whole folder hierarchy.for example

    C:\xx\yy\Desktop\BadWrap 2011\2011 Chevy Camaro C:\xx\yy\Desktop\BadWrap 2011\2011 Chevy Camaro\JPEG\11_Chevy_Camaro D +river.jpg

    I think I only want to now have two columns of info, one being the path and the second being the final folder/image. I don't want to modify the folder names/path, so I can't use the delimiter of \s+ or \t. Is there a way to make it only the last "\" seen per line?